G
Guest
Hi friends,
There is a parameter (integer) for a stored procedure. I need to pass a
value in my C# code, like the follows,
System.Data.SqlClient.SqlParameter sp = new
System.Data.SqlClient.SqlParameter("baseID", System.Data.SqlDbType.Int);
sp.Size = 4;
sp.Value = null;
However, I got an error, saying: Procedure 'sp_InsertBase' expects parameter
'@baseID', which was not supplied.
If I assigne a value like this:
sp.Value = 0;
Then it works fine.
I believe something wrong with the null value. Any ideas? I do need to pass
a null value sometimes.
Thanks a lot
There is a parameter (integer) for a stored procedure. I need to pass a
value in my C# code, like the follows,
System.Data.SqlClient.SqlParameter sp = new
System.Data.SqlClient.SqlParameter("baseID", System.Data.SqlDbType.Int);
sp.Size = 4;
sp.Value = null;
However, I got an error, saying: Procedure 'sp_InsertBase' expects parameter
'@baseID', which was not supplied.
If I assigne a value like this:
sp.Value = 0;
Then it works fine.
I believe something wrong with the null value. Any ideas? I do need to pass
a null value sometimes.
Thanks a lot