IDataRecord.IsDBNull(Int32) IDataRecord.IsDBNull(Int32) IDataRecord.IsDBNull(Int32) IDataRecord.IsDBNull(Int32) Method

定义

返回指定字段是否设置为 null。Return whether the specified field is set to null.

public:
 bool IsDBNull(int i);
public bool IsDBNull (int i);
abstract member IsDBNull : int -> bool
Public Function IsDBNull (i As Integer) As Boolean

参数

i
Int32 Int32 Int32 Int32

要查找的字段的索引。The index of the field to find.

返回

如果指定的字段设置为 null,则为 true;否则为 falsetrue if the specified field is set to null; otherwise, false.

异常

传递的索引位于 0 至 FieldCount 的范围之外。The index passed was outside the range of 0 through FieldCount.

注解

调用此方法以查看是否存在 null 列的值在调用类型化的 get 方法 (例如, GetByteGetChar,依次类推) 以避免引发错误。Call this method to see if there are null column values before calling the typed get methods (for example, GetByte, GetChar, and so on) to avoid raising an error.

适用于