Here are my codes:
string strToday = DateTime.Today.ToShortDateString();
string strTime = DateTime.Now.ToShortTimeString();
DateTime dtmDate = Convert.ToDateTime(strToday + " " + strTime);
e.Values["insertDate"] = dtmDate;
e.Values["modDate"] = dtmDate;
And here's the error I got:
Implicit conversion from data type sql_variant to varbinary is not allowed. Use the CONVERT function to run this query.
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.Data.SqlClient.SqlException:
Implicit conversion from data type sql_variant to varbinary is not
allowed. Use the CONVERT function to run this query.
View Complete Post