共用方式為


DBNull.Value Field

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Represents the sole instance of the DBNull class.

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

Syntax

'Declaration
Public Shared ReadOnly Value As DBNull
public static readonly DBNull Value

Remarks

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 and the Convert.IsDBNull method.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference