Bonjour,
base de données =sql server 2008
visual basic 2010 entreprise
je veux vérifier la présence des enregistrements ou non dans ma table produit_achetes
si il existe des produit alors afficher message
sinon afficher Un msgbox
1 2 3 4 5 6 7 8 9 10 11
| Dim cn As New SqlConnection("Data Source=US_USER;Initial Catalog=Gestionproduit;Integrated Security=True")
Dim str As String = "select * from produit_achetes where Id_operation =1 and Mois=" & cbomois.SelectedItem & " and Année=" & cboannée.SelectedItem & "'"
Dim sda As New SqlDataAdapter(str, cn)
Dim ds As New DataSet
sda.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Ce Produit existe déjà")
Else
msgbox("Vous pouvez effectuer lopération sur ce produit")
End If |
quand j'execute ce code alors une erreur s'affiche
Unclosed quotation mark after the character string
Svp est ce que vous pouvez m'aider a résoudre mon problème
Partager