C
ChrisM
Could anyone please tell me the difference between these 2 lines:
myDate = DateTime.Now;
and
myDate = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyyy"));
Seeing as later on in the code, the ExecuteNonQuery works with the first
option, but not with the second. (I get : {"Data type mismatch in criteria
expression." })
Private OleDbCommand cmd;
....
cmd.Parameters.Add("issueDate",myDate
cmd.ExecuteNonQuery();
The command object is a Access update query with a single date parameter.
Connection string is Jet. Command type is 'StoredProcedure'
Please no-one make any comments about the overload of 'Parameter.Add' I'm
using, I know that if I constructed my parameters properly, I wouldn't get
the problem. I'm just interested as to why one version works and the other
doesn't.
Thanks,
ChrisM.
myDate = DateTime.Now;
and
myDate = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyyy"));
Seeing as later on in the code, the ExecuteNonQuery works with the first
option, but not with the second. (I get : {"Data type mismatch in criteria
expression." })
Private OleDbCommand cmd;
....
cmd.Parameters.Add("issueDate",myDate
cmd.ExecuteNonQuery();
The command object is a Access update query with a single date parameter.
Connection string is Jet. Command type is 'StoredProcedure'
Please no-one make any comments about the overload of 'Parameter.Add' I'm
using, I know that if I constructed my parameters properly, I wouldn't get
the problem. I'm just interested as to why one version works and the other
doesn't.
Thanks,
ChrisM.