DBNull.Value and null sounds like the same thing but they are not.
DBNull.Value is null for the databases while null on the other hand is the null for the string literals.
If you perform an if condition like this:
if(DBNull.Value == null)
{
// print its null
}
else
{
// print its not null
}
It will always print not null since they are not equal at all.
No comments:
Post a Comment