Monthly Archives: June 2010

Exception Passing DBNull.Value to a Varbinary Using Parameters.AddWithValue

In .Net it seems reasonable to try to pass a NULL to a SQL Server stored procedure using the following syntax (C#): myCommand.Parameters.AddWithValue("@MyParameter", DBNull.Value); Unfortunately, if the sproc is expecting a parameter of type Varbinary(max), the following exception will be … Continue reading

Posted in C# | 1 Comment