I am trying to query a DataSet filled with data....
I have a DateTimePicker on a form and when user enters the value I need to query the database with that DateTimePicker.Value.
DataTable dt1 = ds1.Tables;
dateTimePicker1.Format = DateTimePickerFormat.Short;
string strDateTime = dateTimePicker1.Value.ToString();
//perform filter of Dataset
foundrows = ds1.Tables.Select("DrawDate like '" + strDateTime +"'");
Now when I do the above I am getting the following error message.
I have DrawDate as smallDateTime in the database.
"Cannot perform 'like' operation on system.datetime and system.string".
Can someone please tell me where I am going wrong.