I'm trying to get the text from two drop down list to make a query then insert the values of that executed query inside bunch of drop down list. Visual studio doesn't show me any kind of error, but the drop down list do not update. Don't mind if the drop down list on the aspx page do not match with the codeBehind,there are a lot of them.
Front-End Part
<div class="column has-text-centered ">
<div class="box height-20 ">
<div class="spacing-5">
<asp:DropDownList ID="hor_lun_c1" CssClass="ddl-width-200 has-text-justified " runat="server">
</asp:DropDownList>
</div>
<div class="spacing-5">
<asp:DropDownList ID="ddl_lun_c1_nom_mat" CssClass="ddl-width-200 has-text-justified " runat="server">
</asp:DropDownList>
</div>
<div class="spacing-5">
<asp:DropDownList ID="ddl_lun_c1_nom_prof" CssClass="ddl-width-200 has-text-justified " runat="server">
</asp:DropDownList>
</div>
<div class="spacing-5">
<asp:DropDownList ID="ddl_lun_c1_nom_salle" CssClass="ddl-width-200 has-text-justified " runat="server"></asp:DropDownList>
</div>
<div class="spacing-5">
<asp:DropDownList ID="ddl_lun_c1_ratt_ou_exam" CssClass="ddl-width-200 has-text-justified " runat="server"></asp:DropDownList>
</div>
</div>
codeBehind
string nom_na = ddl_na1.SelectedValue;
string fil = ddl_fil.SelectedValue;
MySqlConnection conn = new MySqlConnection(con);
conn.Open();
MySqlCommand charger_li_prof_cmd = conn.CreateCommand();
charger_li_prof_cmd.CommandType = CommandType.Text;
charger_li_prof_cmd.CommandText = "SELECT Professeur.abrv_nom_prof FROM Professeur,Niv_academique,Filiere " +
"WHERE Niv_academique.nom_na = '" + nom_na + "' AND Filiere.nom_fil = '" + fil + "' ";
charger_li_prof_cmd.ExecuteNonQuery();
MySqlDataAdapter da_li_prof = new MySqlDataAdapter(charger_li_prof_cmd);
DataTable dt_li_prof = new DataTable();
da_li_prof.Fill(dt_li_prof);
for (int i = 0; i < dt_li_prof.Rows.Count; i++)
{
string listprof = dt_li_prof.Rows[i].ItemArray[0].ToString();
ddl_lun_c1_nom_prof.Items.Add(listprof);
ddl_lun_c2_nom_prof.Items.Add(listprof);
ddl_lun_c3_nom_prof.Items.Add(listprof);
ddl_lun_c4_nom_prof.Items.Add(listprof);
ddl_mar_c1_nom_prof.Items.Add(listprof);
ddl_mar_c2_nom_prof.Items.Add(listprof);
ddl_mar_c3_nom_prof.Items.Add(listprof);
ddl_mar_c4_nom_prof.Items.Add(listprof);
ddl_mer_c1_nom_prof.Items.Add(listprof);
ddl_mer_c2_nom_prof.Items.Add(listprof);
ddl_mer_c3_nom_prof.Items.Add(listprof);
ddl_mer_c4_nom_prof.Items.Add(listprof);
ddl_jeu_c1_nom_prof.Items.Add(listprof);
ddl_jeu_c2_nom_prof.Items.Add(listprof);
ddl_jeu_c3_nom_prof.Items.Add(listprof);
ddl_jeu_c4_nom_prof.Items.Add(listprof);
ddl_ven_c1_nom_prof.Items.Add(listprof);
ddl_ven_c2_nom_prof.Items.Add(listprof);
ddl_ven_c3_nom_prof.Items.Add(listprof);
ddl_ven_c4_nom_prof.Items.Add(listprof);
ddl_sam_c1_nom_prof.Items.Add(listprof);
ddl_sam_c2_nom_prof.Items.Add(listprof);
ddl_sam_c3_nom_prof.Items.Add(listprof);
ddl_sam_c4_nom_prof.Items.Add(listprof);
}