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#): [sourcecode language=”csharp”] myCommand.Parameters.AddWithValue(“@MyParameter”, DBNull.Value); [/sourcecode] Unfortunately, if the sproc is expecting a parameter of type Varbinary(max), the following … Continue reading

Posted in C# | 1 Comment