1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
private void comboBox_cder_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=soft1\\sqlexpress;" +
"Initial Catalog=gestion_client;Integrated Security=SSPI");
try
{
SqlCommand com = new SqlCommand("select * from dbo.info_cli where code_cli=" + comboBox_cder.Text ,con);
SqlDataAdapter DA = new SqlDataAdapter(com);
DataSet dt = new DataSet();
dt.Tables.Add("dbo.info_cli");
DA.Fill(dt, "client");
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Erreur", MessageBoxButtons.OK);
}
} |
Partager