1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private req As String = "Select count(Fournisseur.NumFour) from (fournisseur inner join commande on Fournisseur.NumFour = Commande.NumFournisseur)inner join Contenir_Commande on Commande.NumCommande = Contenir_Commande.NumCommande where RaisonSocialeFour =@Four"
Private req2 As String = "SELECT Contenir_Commande.NumCommande, Contenir_Commande.NumProduit, Contenir_Commande.QuantiteCommande, Commande.DateCommmande, Fournisseur.RaisonSocialeFour FROM ((Contenir_Commande INNER JOIN Commande ON Contenir_Commande.NumCommande = Commande.NumCommande) INNER JOIN Fournisseur ON Commande.Numfournisseur = Fournisseur.NumFour) Where RaisonSocialeFour = @Four"
Private Sub CbxFournisseur_SelectedValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CbxFournisseur.SelectedValueChanged
Try
Dim con As New OleDb.OleDbConnection("Ma chaine de connexion")
Dim commande As New OleDb.OleDbCommand(req, con)
Dim reader As Integer
con.Open()
commande.Parameters.AddWithValue("@Four", CbxFournisseur.Text)
reader = commande.ExecuteScalar
If reader >= 1 Then
'je ne sais pas quoi mettre !
Else
MsgBox("Aucune commande pour ce fournisseur.")
End If
Catch ex As Exception
MessageBox.Show("" + ex.Message)
End Try
End Sub |
Partager