asp.net.ph

DBNull Class

System Namespace


Represents a null value.

DBNull Class Members

Collapse   Fields

Visibility Name Type
public static Value DBNull

Collapse   Methods

Visibility Name Parameters Return Type
public GetObjectData ( SerializationInfo info , StreamingContext context ) Void
public GetTypeCode ( ) TypeCode
public ToString ( ) String
public ToString ( IFormatProvider provider ) String

Remarks

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

In database applications, a null reference ( Nothing in Visual Basic ) 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 a null reference ( Nothing ) values.

See Also

Convert.DBNull   Convert.IsDBNull   System.Runtime.InteropServices.VarEnum   System.Data.SqlTypes Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph