Erreur dans la syntax update en vb.net
safa
-
safa -
safa -
Bonjour,
j'ai un probleme de modification en vb.net .lorsque j'ai modifié un seul champ j'ai reçus cette erreur: "erreur dans la syntax update"
mais lors de la modification de tous les champs aucune erreur.
voiçi le code :
Cmdr = Cn.CreateCommand()
Cmdr.CommandText = "UPDATE produit SET code_produit=" & CType(TextBox6.Text, Integer) & ",designation='" & TextBox5.Text & "',quantité=" & TextBox7.Text & ",prix_unitaire=" & TextBox8.Text & ",tva=" & ComboBox2.Text & " where (code_produit=" & CType(Me.lv.SelectedItems(0).Text, Integer) & ")"
If Cmdr.ExecuteNonQuery() = 1 Then
MsgBox("modification fait avec succeé.", MsgBoxStyle.Information, "Modification de donnée")
End If
Call affichage()
j'ai un probleme de modification en vb.net .lorsque j'ai modifié un seul champ j'ai reçus cette erreur: "erreur dans la syntax update"
mais lors de la modification de tous les champs aucune erreur.
voiçi le code :
Cmdr = Cn.CreateCommand()
Cmdr.CommandText = "UPDATE produit SET code_produit=" & CType(TextBox6.Text, Integer) & ",designation='" & TextBox5.Text & "',quantité=" & TextBox7.Text & ",prix_unitaire=" & TextBox8.Text & ",tva=" & ComboBox2.Text & " where (code_produit=" & CType(Me.lv.SelectedItems(0).Text, Integer) & ")"
If Cmdr.ExecuteNonQuery() = 1 Then
MsgBox("modification fait avec succeé.", MsgBoxStyle.Information, "Modification de donnée")
End If
Call affichage()
A voir également:
- Erreur dans la syntax update en vb.net
- Windows update bloqué - Guide
- Winget update - Guide
- Asus live update - Télécharger - Utilitaires
- Wsus offline update - Télécharger - Systèmes d'exploitation
- Nettoyage windows update - Guide
If TextBox6.Text = "" Or TextBox5.Text = "" Or TextBox7.Text = "" Or TextBox8.Text = "" Or ComboBox2.Text = "" Then
MsgBox("veuillez remplir les champs", MsgBoxStyle.Exclamation, "Modification de donnée")
Exit Sub
Else
Cmdr = Cn.CreateCommand()
Cmdr.CommandText = "UPDATE produit SET code_produit=" & CType(TextBox6.Text, Integer) & ",designation='" & TextBox5.Text & "',quantité=" & TextBox7.Text & ",prix_unitaire=" & TextBox8.Text & ",tva=" & ComboBox2.Text & " where (code_produit=" & CType(Me.lv.SelectedItems(0).Text, Integer) & ")"
If Cmdr.ExecuteNonQuery() = 1 Then
MsgBox("modification fait avec succeé.", MsgBoxStyle.Information, "Modification de donnée")
End If
Call affichage()
End If
l erreur dans instruction update
les champs ne sont pas vide
l operation n affecte pas à un seul champ
mais pour tous les champs ça marche bien