Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DBNull Class

Represents a null value.

For a list of all members of this type, see DBNull Members.

System.Object
   System.DBNull

[Visual Basic]
<Serializable>
NotInheritable Public Class DBNull
   Implements ISerializable, IConvertible
[C#]
[Serializable]
public sealed class DBNull : ISerializable, IConvertible
[C++]
[Serializable]
public __gc __sealed class DBNull : public ISerializable,
   IConvertible
[JScript]
public
   Serializable
class DBNull implements ISerializable, IConvertible

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This class is used to indicate the absence of a known value, typically in a database application.

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.

Requirements

Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

DBNull Members | System Namespace | Convert.DBNull | Convert.IsDBNull | System.Runtime.InteropServices.VarEnum | System.Data.SqlTypes

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.