i need to filter my table between 2 dates
but it makes wrong filtering really i dont understand why. but it might be my wrong codes
here is my codes... what should i do?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim da As New SqlDataAdapter("SELECT * FROM TableName WHERE DateColumn BETWEEN '" & _
DateTimePicker1.Value & "' AND '" & DateTimePicker2.Value & "'", Connection)
Dim dt As New DataTable
da.Fill(dt)
Dim dv As New DataView(dt)
DataGridView1.DataSource = dv
End Sub
Thanks for your helping :)