i m trying to featch record on the bases of datetimepicker value but i m getting error
the error Data type mismatch in criteria expression. Please Help me
OleDbDataAdapter a = new OleDbDataAdapter("select * from data where date_of_complaint=" + dateTimePicker3.Value.Date + ";", con);
DataTable t = new DataTable();
dataGridView1.DataSource = t;
I have always found when working with dates in dbs the east thing to do is convert your datetime to a string with format "DD-MMM-YYYY" to remove any ambiguity over mm-dd or dd-mm localizations.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)