Value Field
Collapse the table of content
Expand the table of content

DBNull::Value Field


Represents the sole instance of the DBNull class.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static initonly DBNull^ Value

Field Value

Type: System::DBNull^

DBNull is a singleton class, which means only this instance of this class can exist.

If a database field has missing data, you can use the DBNull::Value property to explicitly assign a DBNull object value to the field. However, most data providers do this automatically.

To evaluate database fields to determine whether their values are DBNull, you can pass the field value to the DBNull.Value.Equals method. However, this method is rarely used because there are a number of other ways to evaluate a database field for missing data. These include the Visual Basic IsDBNull function, the Convert::IsDBNull method, the DataTableReader::IsDBNull method, the IDataRecord::IsDBNull method, and several other methods.

The following example calls the DBNull.Value.Equals method to determine whether a database field in a contacts database has a valid value. If it does, the field value is appended to the string output in a label.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft