zhoullhh
03-29-2007, 03:35 AM
:( I am using Spring.NET to access MS Access database. One of the column in the table is "DateTime".
I added my Parameter by the following way,
parameters.Add("DtReceived", DbType.DateTime).Value =DtReceived;
However, when I looked at the new Parameter, it OldDbType shows as "DbTimeStamp", which is not correct since the field in database is a DateTime field, but the DbType is "DateTime" which is correct.
The "DbTimeStamp" cause the following
"Data type mismatch in criteria expression. (Microsoft JET Database Engine)".
I tried to replace DbType.DateTime by OleDbType.DateTime, it works fine without problem. However, I can not do that since I have to support SQL Server, Oracle as well.
I also tried to use DbType.Date, it worked, however, it truncates the time information which based on the name, should be correct.
I tried to dig into some of the code of Spring to see where the parameter type get assigned, but can not find too much help there.
Appreciate any help here!!!
I added my Parameter by the following way,
parameters.Add("DtReceived", DbType.DateTime).Value =DtReceived;
However, when I looked at the new Parameter, it OldDbType shows as "DbTimeStamp", which is not correct since the field in database is a DateTime field, but the DbType is "DateTime" which is correct.
The "DbTimeStamp" cause the following
"Data type mismatch in criteria expression. (Microsoft JET Database Engine)".
I tried to replace DbType.DateTime by OleDbType.DateTime, it works fine without problem. However, I can not do that since I have to support SQL Server, Oracle as well.
I also tried to use DbType.Date, it worked, however, it truncates the time information which based on the name, should be correct.
I tried to dig into some of the code of Spring to see where the parameter type get assigned, but can not find too much help there.
Appreciate any help here!!!