private void Load_Presations_Validees() { try { conn = new MySqlConnection(Authentification.MyString); conn.Open(); //Jour_Prestation_ListView.Items.Clear(); string ra = "SELECT prestation.id_prestation, horaire.jour, horaire.date, prestation.heureD, prestation.heureF, horaire.periode" + " FROM (cours INNER JOIN horaire ON cours.id_cours = horaire.id_cours) INNER JOIN prestation ON horaire.id_horaire = prestation.id_horaire" + " WHERE cours.id_cours=@id_cours"; MySqlCommand cmd = new MySqlCommand(ra, conn); cmd.Parameters.AddWithValue("@id_cours", id_cours); MySqlDataReader dr = cmd.ExecuteReader(); Jour_Prestation_ListView.RowStyle.HorizontalAlign = HorizontalAlign.Center; Jour_Prestation_ListView.DataSource = dr; Jour_Prestation_ListView.DataBind(); dr.Close(); conn.Close(); } catch (Exception ex) { //MessageBox.Show(ex.Message); } }
protected void Jour_Prestation_ListView_PageIndexChanging(object sender, GridViewPageEventArgs e) { Jour_Prestation_ListView.PageIndex = e.NewPageIndex; Jour_Prestation_ListView.DataBind(); Load_Presations_Validees(); }