3
Reply

Error : Data type mismatch in criteria expression. (Using M

Paul Rajs

Paul Rajs

May 3 2017 4:38 AM
217
hi Developers ,
when i retrive datas from database i got the following error.
OleDb Exception Was Unhandled
Data type mismatch in criteria expression. (Using Ms Access db)
i don't know what is wrong with my code.below am adding my using code
string str = "select AttendanceLogs.*,Shifts.EndTime,Shifts.BeginTime,Shifts.Break1,Shifts.Break1BeginTime,Break1EndTime from AttendanceLogs inner join Shifts on Shifts.ShiftId = AttendanceLogs.ShiftId where AttendanceDate between '" + sDate + "' AND '" +tDate + "' and EmployeeId ='" + edr.GetValue(0) + "'";
OleDbCommand getLogs = new OleDbCommand(str, Conn);
OleDbDataReader dr = getLogs.ExecuteReader();
so please suggest me if i done any wron in my code.
thanks with
Paul.S

Answers (3)