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!

DataRow.IsNull (String)

Gets a value indicating whether the named column contains a null value.

[Visual Basic]
Overloads Public Function IsNull( _
   ByVal columnName As String _
) As Boolean
[C#]
public bool IsNull(
   string columnName
);
[C++]
public: bool IsNull(
   String* columnName
);
[JScript]
public function IsNull(
   columnName : String
) : Boolean;

Parameters

columnName
[To be supplied.]

Return Value

true if the column contains a null value; otherwise, false.

Example [Visual Basic]

The following example changes the value of a column to a null value, then uses the IsNull method to determine if the value is null.

[Visual Basic]

Private Sub IsValNull()
   Dim t As DataTable
   Dim r As DataRow
   ' Assuming the DataGrid is bound to a DataTable.
   t = DataGrid1.DataSource

   r = t.Rows(datagrid1.CurrentCell.RowNumber)
   r.BeginEdit
   r("FirstName") = Null
   r.EndEdit
   r.AcceptChanges
   Console.WriteLine(r.IsNull("FirstName"))
End Sub

See Also

DataRow Class | DataRow Members | System.Data Namespace | DataRow.IsNull Overload List