다음을 통해 공유


ColumnAttribute.CanBeNull Property

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

Gets or sets whether a column can contain null values.

Namespace:  System.Data.Linq.Mapping
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

Syntax

'Declaration
Public Property CanBeNull As Boolean
public bool CanBeNull { get; set; }

Property Value

Type: System.Boolean
Default = true.

Remarks

If you set this value to false, the data in the corresponding column is assumed to be non-null.

NoteNote:

This property is duplicated from the DbType property for convenience. The CreateDatabase method uses only the DbType property. For this reason, you must specify whether a column can contain null values in the DbType property also.

Version Information

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

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