1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Mycmd As New OleDbCommand
Dim cmdSomme As New OleDbCommand
Try
If Not MyConnexion.State = ConnectionState.Open Then
MyConnexion.Open()
End If
Mycmd.Connection = MyConnexion
cmdSomme.Connection = MyConnexion
Mycmd.CommandText = "SELECT DateFact, NumFacture, RefTapis, CtrlTapis, Prix, Commission, Somme From Vente " & _
" WHERE (DateFact > #" & Format(DateTimePicker1.Value, "yyyy/MM/dd") & "# and DateFact < #" & Format(DateTimePicker2.Value, "yyyy/MM/dd") & "#)" & _
" AND " & "(IdPersonnel = " & Me.ComboBox1.Text & ")"
Dim da As New OleDbDataAdapter(Mycmd.CommandText, MyConnexion)
Dim dt As New DataTable
da.Fill(dt)
Me.DataGridView1.DataSource = dt
MyConnexion.Close()
Catch ex As Exception
MsgBox("Message d'erreur : " & ex.Message)
End Try
End Sub |
Partager