Export (0) Print
Expand All

IDataRecord.IsDBNull Method

Return whether the specified field is set to null.

[Visual Basic]
Function IsDBNull( _
   ByVal i As Integer _
) As Boolean
[C#]
bool IsDBNull(
   int i
);
[C++]
bool IsDBNull(
   int i
);
[JScript]
function IsDBNull(
   i : int
) : Boolean;

Parameters

i
The index of the field to find.

Return Value

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

Exceptions

Exception Type Condition
IndexOutOfRangeException The index passed was outside the range of 0 through FieldCount.

Remarks

Call this method to check for null column values before calling the typed get methods (for example, GetByte, GetChar, and so on) to avoid raising an error.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

IDataRecord Interface | IDataRecord Members | System.Data Namespace

Show:
© 2014 Microsoft