I am populating tables using a stored procedure. The table allows a \'null\' for the middle initial of the name, but I\'m getting the following error message:
There are two options here:
Modify you stored procedure and make @MiddleInitial param optional (which is currently not optional that's why error is thrown)
@MiddleInitial nvarchar(10) = NULL
Or add following line to your code:
cmd.Parameters.AddWithValue("@MiddleInitial", null);