1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
AdapTContact = New OleDbDataAdapter("select * personne where (date_naissance between @d and @f ", Connection)
AdapTContact.SelectCommand.Parameters.Add(New OleDbParameter("@d", OleDbType.Date))
AdapTContact.SelectCommand.Parameters.Add(New OleDbParameter("@f", OleDbType.Date))
AdapTContact.SelectCommand.Parameters("@d").Value = Me.DateTimePicker1.Value
AdapTContact.SelectCommand.Parameters("@f").Value = Me.DateTimePicker2.Value
AdapTContact.Fill(DtSet, "personne ")
Dim Matable As DataTable
Matable = DtSet.Tables("personne ")
DataGrid1.DataSource = Matable
Matable.Clear()
AdapTContact.Fill(DtSet, "personne ")
DataGrid1.Select(0)
DataGrid1.CurrentRowIndex = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub |