A
Alex
Why am I getting the following error?
/*
TYPE: System.Data.OleDb.OleDbException
MESSAGE: Operator/operand type mismatch.
*/
It happens at the ExecuteReader() statement.
I am trying to access a dbf file and it works when I don’t include any
dates in my WHERE clause (i.e. my clause looks like: WHERE termcd =
‘SA’). Here is the relevant code:
/*
string sql = "SELECT tel FROM results WHERE termcd = 'SA' AND lcdate
OleDbConnection con = new OleDbConnection(resultsFolder);
OleDbCommand cmd = new OleDbCommand(sql, con);
OleDbDataReader r = null;
con.Open();
r = cmd.ExecuteReader();
*/
Do I need to surround the dates with hashes or something for them to
register as dates?
/*
TYPE: System.Data.OleDb.OleDbException
MESSAGE: Operator/operand type mismatch.
*/
It happens at the ExecuteReader() statement.
I am trying to access a dbf file and it works when I don’t include any
dates in my WHERE clause (i.e. my clause looks like: WHERE termcd =
‘SA’). Here is the relevant code:
/*
string sql = "SELECT tel FROM results WHERE termcd = 'SA' AND lcdate
dateTo.Value.ToString(@"MM/dd/yyyy");= " + dateFrom.Value.ToString(@"MM/dd/yyyy") + " AND lcdate <= " +
OleDbConnection con = new OleDbConnection(resultsFolder);
OleDbCommand cmd = new OleDbCommand(sql, con);
OleDbDataReader r = null;
con.Open();
r = cmd.ExecuteReader();
*/
Do I need to surround the dates with hashes or something for them to
register as dates?