System.Data.IDataRecord.IsDBNull Method

Return whether the specified field is set to null.

Syntax

public bool IsDBNull (int i)

Parameters

i
The index of the field to find.

Returns

true if the specified field is set to null; otherwise, false.

Remarks

Call this method to see if there are null column values before calling the typed get methods (for example, System.Data.SqlClient.SqlDataReader.GetByte(int), System.Data.SqlClient.SqlDataReader.GetChar(int), and so on) to avoid raising an error.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0