Using .NET 4 and C#. All of these throw an error:
sdsTypeinfo.SelectParameters.Add("@TypeCode", DbType.Boolean, DBNull.Value);
sdsTypeinfo.SelectParameters.Add("@TypeCode", DBNull.Value);
sdsTypeinfo.SelectParameters.Add("@TypeCode", null);
sdsTypeinfo.SelectParameters.Add("@TypeCode", "");
The error indicates that the procedure is not getting any value at all.
Procedure or function 'Typeinfo' expects parameter '@TypeCode', which was not supplied.
Answer
You don't need the @ in the name of the parameter. This is different than adding parameters when calling the stored procedure using a SqlCommand, in which case you want something like this:
cmd.Parameters.AddWithValue("@TypeCode", DBNull.Value);
Also, DBNull.value is an acceptable parameter in the above, but the accepted NULL value when adding SelectParameters to an SqlDataSource is simply "null".
@pTypeCodeand you are passing in@TypeCode...