asp.net.ph

DataRow.IsNull Method ( DataColumn )

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

Parameters

column
A DataColumn.

Return Value

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.

Example

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 ( );
         }
      }
    }
}
  C# VB

See Also

DataRow Members   DataRow.IsNull Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph