I have following code and I can filter data on grid but when I pick same date in 2 datepicker it shows nothing. How can I fix the problem. Any help will be appreciated.
con = New SqlCeConnection(constring)
con.Open()
cmd = New SqlCeCommand("SELECT * FROM tblMeter WHERE (Date >= @startDate) AND (Date < @endDate)", con)
Dim param1, param2 As SqlCeParameter
param1 = New SqlCeParameter("@startDate", DateTimePicker1.Value)
param2 = New SqlCeParameter("@endDate", DateTimePicker2.Value)
cmd.Parameters.Add(param1)
cmd.Parameters.Add(param2)
Dim da As New SqlCeDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
con.Close()
DataGridView1.DataSource = dt
Thanks