asp.net.ph

SqlDataReader.FieldCount Property

System.Data.SqlClient Namespace   SqlDataReader Class


Returns the number of columns in the current row.

Syntax


Script [ integer variable = ] SqlDataReader.FieldCount

Property Value


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.

Exceptions


Exception Type Condition
NotSupportedException Occurs when there is no current connection to an instance of SQL Server.

Remarks

After executing a query that does not return rows, FieldCount returns 0.

See Also

SqlDataReader Members Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note