C
C
sqlParameterLastUpdatedDate = new SqlParameter();
sqlParameterLastUpdatedDate.ParameterName =
"@lastUpdatedDate";
sqlParameterLastUpdatedDate.SqlDbType =
SqlDbType.DateTime;
sqlParameterLastUpdatedDate.Value =
DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss:fff"));
sqlParameterLastUpdatedDate.Direction =
ParameterDirection.Input;
When I add this to parameter to my command object I get "Cannot conver
String to DateTime" beause I am assigning a string to the Value. I need my
date in the above format. How can I get this format without having it as a
string?
Any help appreciated.
sqlParameterLastUpdatedDate.ParameterName =
"@lastUpdatedDate";
sqlParameterLastUpdatedDate.SqlDbType =
SqlDbType.DateTime;
sqlParameterLastUpdatedDate.Value =
DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss:fff"));
sqlParameterLastUpdatedDate.Direction =
ParameterDirection.Input;
When I add this to parameter to my command object I get "Cannot conver
String to DateTime" beause I am assigning a string to the Value. I need my
date in the above format. How can I get this format without having it as a
string?
Any help appreciated.