bonjour ,
j'ai un problème et je suis dessus depuis de nombreuse heures .
jai mis le code suivant :
private void pneu_SelectedIndexChanged(object sender, EventArgs e)
{
SqlCommand com = new SqlCommand();
SqlConnection con = new SqlConnection("Data Source=CHAIMA;Initial Catalog=OptiMaint;Integrated Security=True");
SqlDataReader dr;
com.CommandText = " select ORG_DESIGNATION , ORG_FAMILLE , ORG_GROUPE ,ORG_PRIX_ACHAT , ORG_IMAGE from dbo.ORGANES where dbo.ORGANES ='" + pneu.Text + "'";
com.Connection = con;
con.Open();
dr = com.ExecuteReader(); // c'est au ce niveau de cette ligne que l'exception s'est levée
while (dr.Read())
{
textBox1.Text = dr["ORG_DESIGNATION"].ToString();
textBox2.Text = dr["ORG_FAMILLE"].ToString();
textBox3.Text = dr["ORG_GROUPE"].ToString();
textBox4.Text = dr["ORG_PRIX_ACHAT"].ToString();
photo.ImageLocation = dr["ORG_IMAGE"].ToString();
}
con.Close();
}
je me suis bloqué et je ne sais pas quoi faire.
j'attens vos suggestions .