DB2®DataReader.FieldCount Property

Gets the number of columns in the current row.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
Public ReadOnly Property FieldCount As Integer
[C#]
public int FieldCount {get;}
[C++]
public: __property int get_FieldCount();
[JScript]
public function get FieldCount() : int;

Property value

When not positioned in a valid record set, 0; otherwise the number of columns in the current record. The default is -1.

Exceptions

Exception type Condition
NotSupportedException There is no current connection to a database.

Remarks

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