DBNull is a special value in The .Net framework indicating that the value is NULL in the database.
DBNull is a special value in the .Net framework indicating that the value is NULL in the database. It is required to disambiguate with .Net null, which basically means 'null pointer' or unallocated variable. Since it is a special value, it requires special handling to convert into other data types, check DB data for null values etc.
.Net uses System.DBNull singleton class to handle null database values.
The
DBNullclass represents a nonexistent value. In a database, for example, a column in a row of a table might not contain any data whatsoever. That is, the column is considered to not exist at all instead of merely not having a value. ADBNullobject represents the nonexistent column. Additionally, COM interop uses theDBNullclass to distinguish between aVT_NULLvariant, which indicates a nonexistent value, and aVT_EMPTYvariant, which indicates an unspecified value.
In a relational database, null is used to describe a missing/unknown value, not to be confused with oop null (Nothing in vb.net) - that's a reference that points nowhere.