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;
true if the column contains a null value; otherwise, false.
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
DataRow Class | DataRow Members | System.Data Namespace | DataRow.IsNull Overload List