SQLParameter.SqlValue is {Null} but can't test for null?

Posted by Rajanarayanan under ASP.NET on 5/11/2012 | Points: 10 | Views : 3603 | Status : [Member] | Replies : 0
Returned SQLParameter.SqlValue is {Null} but can't test for null?

In my Stored procedure output parameter return Null value in C# but can't test for null..

Below are my coding :

if (cmd.Parameters["@AswathID"].SqlValue != DBNull.Value) ----> Can't test null here.
{
objDbProperty.AswathAmount = (int)cmd.Parameters["@AswathID"].Value;
}
else
{
objDbProperty.AswathAmount = 0;
}
Kindly Reply me.

Thanks & Regards
Narayanan P



Responses

(No response found.)

Login to post response