Voila une partie du code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Then
MsgBox(" vous devez remplir tous les champs", MsgBoxStyle.Critical)
Else
Try
con.Open()
cmd.Connection = con
cmd.CommandText = "select * from article "
dr = cmd.ExecuteReader
dr.Read()
If dr.HasRows Then
cmd.CommandText = "INSERT INTO sortie VALUES ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')"
dr.Close()
MsgBox("ajout réussi", MsgBoxStyle.Information)
dr = cmd.ExecuteReader
dr.Read()
cmd.CommandText = "update stock set derniere_sortie=('" + TextBox2.Text + "') where numpiece=('" + TextBox1.Text + "')"
dr.Close()
cmd.ExecuteNonQuery()
MsgBox("ajout réussi", MsgBoxStyle.Information)
la mise a jour ne s'effectue pa et il affiche le msg d'erreur que j'ai deja signaler dans le premier msg