Описание тега dbnull
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
DBNull
class 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. ADBNull
object represents the nonexistent column. Additionally, COM interop uses theDBNull
class to distinguish between aVT_NULL
variant, which indicates a nonexistent value, and aVT_EMPTY
variant, 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.