OdbcDataReader.FieldCount 属性

定义

获取当前行中的列数。

public:
 virtual property int FieldCount { int get(); };
public:
 property int FieldCount { int get(); };
public override int FieldCount { get; }
public int FieldCount { get; }
member this.FieldCount : int
Public Overrides ReadOnly Property FieldCount As Integer
Public ReadOnly Property FieldCount As Integer

属性值

Int32

如果不是位于有效的记录集中,则为 0;否则为当前记录的列数。 默认值为 -1。

实现

例外

没有到数据源的当前连接。

注解

包括隐藏的字段。 使用 VisibleFieldCount 可排除隐藏的字段。

执行不返回行的查询后, FieldCount 返回 0。

适用于

另请参阅