[Serializable] |
In database applications, a null object is a valid value for a field. This class differentiates between a null value (a null object) and an uninitialized value (the DBNull.Value instance). For example, a table can have records with uninitialized fields. By default, these uninitialized fields have the DBNull value.
This class is also used in COM Interop to distinguish between a VT_NULL variant, which is associated with a null object, and a VT_EMPTY variant, which is associated with the DBNull.Value instance.
DBNull is never equal to anything.
DBNull is a singleton class, which means only one instance of this class can exist. That sole instance is DBNull.Value.
Data intensive applications accessing SQL databases must use the System.Data.SqlTypes classes, which have inherent support for null values.
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetObjectData | Implements the ISerializable interface and returns the data needed to serialize the DBNull object. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
GetTypeCode | |
ToString | Overloaded:ToString() Overridden: Returns an empty string ( String.Empty). |
ToString | Overloaded:ToString(IFormatProvider provider) Returns an empty string using the specified IFormatProvider. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public static readonly DBNull Value;
|
~DBNull(); |
public virtual int GetHashCode(); |
public void GetObjectData( |
info
context
Exception Type | Condition |
---|---|
ArgumentNullException | info is null. |
public Type GetType(); |
public TypeCode GetTypeCode(); |
protected object MemberwiseClone(); |
public override string ToString(); |
public string ToString( |
provider
null to obtain the format information from the current locale setting of the operating system.
-or-null to obtain the format information from the current locale setting of the operating system.