I try to do this for couple of hours.
Database db = DBUtil.GetInstance().GetDataBase();
DbCommand cmd = db.GetSqlStringCommand(@"INSERT INTO [XXX] (
...
,[FirstDate]
...
) VALUES ('@FirstDate',...");
db.AddInParameter(cmd, "@FirstDate", DbType.Date, DateTime.Now );
But I always get this exception information below.
{System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting date and/or time from character string.
what should I do for the conversion ? Or pick up another DbType ? DbType.DateTime2 ?