How to search by
Datetimepicker from SQL where date column is of
date datatype and my dates in SQL tables are in
I am getting error
Failed to convert parameter value from a String to a DateTime.FormatException: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0
How to do this? Kindly help.
Dim x = Form1.DateTimePicker1.Value.Date Dim y = Form1.DateTimePicker2.Value.Date Using cmd As New SqlCommand("select id,code from codedata where date >= @init AND date <= @end", con) cmd.Parameters.Add("@init", SqlDbType.Date).Value = x cmd.Parameters.Add("@end", SqlDbType.Date).Value = y