NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataColumn.AllowNull

Gets or sets a value indicating whether null values are allowed in this column for rows belonging to the table.

[Visual Basic]
Public Property AllowNull As Boolean
[C#]
public bool AllowNull {get; set;}
[C++]
public: __property bool get_AllowNull();
public: __property void set_AllowNull(bool);
[JScript]
public function get AllowNull() : Boolean;
public function set AllowNull(Boolean);

Property Value

true if null values values are allowed; otherwise, false. The default is true.

Remarks

If the Unique property is true, then one null value is allowed.

The OnPropertyChanged [member, System.Data.DataColumn] occurs when the change is successful.

Example [Visual Basic]

The following example creates a new DataColumn and sets its AllowNull property to true.

[Visual Basic]

Private Sub AddNullAllowedColumn()
   Dim myColumn As DataColumn
   myColumn = New DataColumn("classID", System.Type.GetType("System.Int32"))
   myColumn.AllowNull = True
   ' Add the column to a new DataTable
   Dim myTable As DataTable
   myTable = New DataTable
   myTable.Columns.Add(myColumn)
End Sub

See Also

DataColumn Class | DataColumn Members | System.Data Namespace | Unique | OnPropertyChanged