System.Data Namespace IDataRecord Class
Returns the number of columns in the current row.
Script |
[ integer variable = ] IDataRecord.FieldCount |
variable |
Returns the number of columns in the current row. |
The property is read only with a default value of -1.
Exception Type |
Condition |
NotSupportedException |
Occurs when there is no current connection to a data source. |
When not positioned in a valid recordset, FieldCount returns 0; otherwise, returns the number of columns in the data source.
After executing a query that does not return rows, such as when using the ExecuteNonQuery method, FieldCount returns -1.
IDataRecord Members