Value types can not store a null value.
Int32 IntLevel;
and
Int32 IntLevel = 0;
both do the same thing, create a new integer value and set its initial value to 0.
DBNull, is not the same as 'null' - it is a class used by the database providers to signify a Null in a database field. So you are never (ever) going to be able to assign DBNull.Value to an integer variable.
There is a generic type called Nullable<> (or Nullable(Of) in
VB.Net) which can be used to store null values as well as value types.
Nullable<Int32> IntLevel = null;
or
Nullable<Int32> IntLevel = 12;
in C# you can abbreviate Nullable<Int32> to int?.
int? IntLevel = null;
/- Sam Judson : Wrox Technical Editor -/