1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
#region change txt
SqlConnection sSqlcon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
sSqlcon.Open();
string Req= "Select ID_Grossiste,ID_Grossiste From grossiste where NOM_GROSSISTE = '"+comboBox1.SelectedItem+"'";
cmd = new SqlCommand(Req,sSqlcon);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
if(comboBox1.Text!="TOUT")
{
textBox1.Text = dr["NOM_GROSSISTE"].ToString();
}
}
dr.Close();
sSqlcon.Close();
#endregion
} |
Partager