System.Data.SqlClient Namespace SqlDataReader Class
Returns the number of columns in the current row.
Script |
[ integer variable = ] SqlDataReader.FieldCount |
variable |
When not positioned in a valid recordset, 0; otherwise 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 an instance of SQL Server. |
After executing a query that does not return rows, FieldCount returns 0.
SqlDataReader Members