Hi friends, I have a table named "bon récéption " and which contains a foreign key Id_marche and in the interface of "bon récéption " I filled the combobox of the "libélllé marche"short market the problem is in button modify when I want to modify gives me this error I will extract here my code and the error thank you in advance
Program.cmd.CommandText = "update bon_reception_marche set Id_marche = (select distinct Id_marche from marche where Libelle_marche = '" + comboBox3.Text + "') ,Designation_bon_reception ='" + textBox2.Text + "',Num_bon_reception='" + textBox1.Text + "',Date_reception ='" + dateTimePicker1.Value.Date + "',Unite ='" + textBox3.Text + "',Qte= " + Convert.ToDouble(textBox4.Text) + ",Prix_unitaire=" + Convert.ToDouble(textBox5.Text) + ",Montant =" + Convert.ToDouble(textBox6.Text) + ",TVA =" + Convert.ToDouble(comboBox1.Text) + ",MO ='" + textBox8.Text + "',OT ='" + textBox9.Text + "' where Id_bon_reception_marche ="+textBox7.Text;
Le format de la chaîne d'entrée est incorrect.
Program.cmd.CommandText = "update bon_reception_marche set Id_marche = (select distinct Id_marche from marche where Libelle_marche = @Libelle_marche), Designation_bon_reception = @Designation_bon_reception, Num_bon_reception = @Num_bon_reception, Date_reception = @Date_reception, Unite = @Unite, Qte = @Qte, Prix_unitaire = @Prix_unitaire, Montant = @Montant, TVA = @TVA, MO = @MO, OT = @OT where Id_bon_reception_marche = @Id_bon_reception_marche"; Program.cmd.Parameters.AddWithValue("@Libelle_marche", comboBox3.Text); Program.cmd.Parameters.AddWithValue("@Designation_bon_reception", textBox2.Text); Program.cmd.Parameters.AddWithValue("@Num_bon_reception", textBox1.Text); Program.cmd.Parameters.AddWithValue("@Date_reception", dateTimePicker1.Value.Date); Program.cmd.Parameters.AddWithValue("@Unite", textBox3.Text); Program.cmd.Parameters.AddWithValue("@Qte", Convert.ToDouble(textBox4.Text)); Program.cmd.Parameters.AddWithValue("@Prix_unitaire", Convert.ToDouble(textBox5.Text)); Program.cmd.Parameters.AddWithValue("@Montant", Convert.ToDouble(textBox6.Text)); Program.cmd.Parameters.AddWithValue("@TVA", Convert.ToDouble(comboBox1.Text)); Program.cmd.Parameters.AddWithValue("@MO", textBox8.Text); Program.cmd.Parameters.AddWithValue("@OT", textBox9.Text); Program.cmd.Parameters.AddWithValue("@Id_bon_reception_marche", textBox7.Text);
Convert.ToDouble
textBox42
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)