System.Data Namespace DataRow Class
Checks whether the specified DataColumn contains a null value.
[ VB ]
Overloads Public Function IsNull ( _
ByVal column As DataColumn _
) As Boolean
[ C# ]
public bool IsNull (
DataColumn column
);
[ C++ ]
public: bool IsNull (
DataColumn* column
);
[ JScript ]
public function IsNull (
column : DataColumn
) : Boolean
- column
- A DataColumn.
This method returns only a boolean value: true if the column contains a null value; otherwise, false.
The property is read only with no default value.
The following example prints each column of each row in each table of a DataSet. If the row is set to a null value, the value is not printed.
private void PrintRows ( ds As DataSet )
DataTable tbl;
DataColumn col;
DataRow row;
foreach ( tbl in ds.Tables ) {
foreach ( row in tbl.Rows ) {
foreach ( col in tbl.Columns ) {
if ( !row.IsNull ( col ) ) Response.Write ( row ( col ) ).ToString ( );
}
}
}
}
Private Sub PrintRows ( ds As DataSet )
Dim tbl As DataTable
Dim col As DataColumn
Dim row As DataRow
For Each tbl In ds.Tables
For Each row In tbl.Rows
For Each col In tbl.Columns
If Not row.IsNull ( col ) Then Response.Write ( row ( col ) ).ToString ( )
Next col
Next row
Next tbl
End Sub |
|
C# |
VB |
DataRow Members DataRow.IsNull Overload List