googou <go****@discussions.microsoft.com> wrote:
I think this is better:
Convert.IsDBNull(SomeValue);
and the 'is' keyword can not be used in this case
Yes it can. The only value of DBNull is DBNull.Value - any reference
which "is" a DBNull is DBNull.Value, so
if (x is DBNull) is exactly equivalent to if (x==DBNull.Value). The
only difference using Convert.IsDBNull is if x is an instance of a type
which implements IConvertible with a GetTypeCode method returning
TypeCode.DBNull.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too