Assigning a null value to some ASP.Net parameterized queries
In some situations an error will be thrown when trying to assign “null” to a parameter for a query. In this situation, assign “DBNull.Value” to the parameter.
Example:
thisCommand.Parameters.Add(“@datLastCalExpr”, System.Data.SqlDbType.DateTime).Value = DBNull.Value;
Categories: Uncategorized