次の方法で共有


SqlDataReader.FieldCount プロパティ

現在の行の列数を取得します。

Public Overridable ReadOnly Property FieldCount As Integer  _   Implements IDataRecord.FieldCount
[C#]
public virtual int FieldCount {get;}
[C++]
public: __property virtual int get_FieldCount();
[JScript]
public function get FieldCount() : int;

プロパティ値

有効なレコードセットに位置していない場合は 0。それ以外の場合は現在の行の列数。既定値は -1 です。

実装

IDataRecord.FieldCount

例外

例外の種類 条件
NotSupportedException SQL Server のインスタンスへの現在の接続がありません。

解説

行を返さないクエリを実行した後は、 FieldCount は 0 を返します。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

SqlDataReader クラス | SqlDataReader メンバ | System.Data.SqlClient 名前空間