Hello everybody, im new..I want to filter my datagridview with datetimepicker.. I have 2 datetimepicker in my form and a datagridview. I want to filter my datagridview by date using datetimepicker,. what I did was I put the value of my two datetimepicker into two texboxes ive done it evrytime i change the value of my DTpicker, so, the input is not a problem,. but im confused on how to code it for filtering my datagridview with the input on my textbox where the 1st textbox is the start date and the 2nd textbox is the end date..
pleease help me...
here's the code for my query
Dim d1 As String = Me.TextBox2.Text
Dim d2 As String = Me.TextBox3.Text
Dim query As String
query = "select * from attendance where AttendanceDate like '" & ???? & "'"
Dim connection As New MySqlConnection(connStr)
Dim cmd As New MySql.Data.MySqlClient.MySqlCommand(query, connection)
Dim dset As New DataSet
Dim dadp As New MySql.Data.MySqlClient.MySqlDataAdapter
dset.Clear()
connection.Open()
dadp.SelectCommand = cmd
dadp.Fill(dset, "attendance")
DataGridView1.DataSource = dset.Tables(0)
the textboxes hir has already the value of my DTpicker..
pleease help me...
here's the code for my query
Dim d1 As String = Me.TextBox2.Text
Dim d2 As String = Me.TextBox3.Text
Dim query As String
query = "select * from attendance where AttendanceDate like '" & ???? & "'"
Dim connection As New MySqlConnection(connStr)
Dim cmd As New MySql.Data.MySqlClient.MySqlCommand(query, connection)
Dim dset As New DataSet
Dim dadp As New MySql.Data.MySqlClient.MySqlDataAdapter
dset.Clear()
connection.Open()
dadp.SelectCommand = cmd
dadp.Fill(dset, "attendance")
DataGridView1.DataSource = dset.Tables(0)
the textboxes hir has already the value of my DTpicker..
Last edited: