IDataRecord.FieldCount IDataRecord.FieldCount IDataRecord.FieldCount IDataRecord.FieldCount Property

定义

获取当前行中的列数。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.

注解

执行不返回行的查询 (例如, 使用ExecuteNonQuery方法) 后, FieldCount将返回-1。After executing a query that does not return rows (for example, using the ExecuteNonQuery method), FieldCount returns -1.

适用于