OdbcDataReader.FieldCount 属性

定义

获取当前行中的列数。Gets the number of columns in the current row.

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;否则为当前记录的列数。When not positioned in a valid record set, 0; otherwise the number of columns in the current record. 默认值为 -1。The default is -1.

实现

例外

没有到数据源的当前连接。There is no current connection to a data source.

注解

包括隐藏的字段。Includes hidden fields. 使用 VisibleFieldCount 可排除隐藏的字段。Use VisibleFieldCount to exclude hidden fields.

执行不返回行的查询后,将 FieldCount 返回0。After you execute a query that does not return rows, FieldCount returns 0.

适用于