OleDbDataReader.FieldCount 属性

定义

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

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

属性值

如果未放在有效的记录集中,则为 0;否则为当前记录的列数。When not positioned in a valid recordset, 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 executing a query that does not return rows, FieldCount returns 0.

适用于

另请参阅