次の方法で共有


SqlDataReader.GetInt32 メソッド

指定した列の値を 32 ビット符号付き整数として取得します。

Public Overridable Function GetInt32( _
   ByVal i As Integer _) As Integer Implements IDataRecord.GetInt32
[C#]
public virtual int GetInt32(inti);
[C++]
public: virtual int GetInt32(inti);
[JScript]
public function GetInt32(
   i : int) : int;

パラメータ

  • i
    列の 0 から始まる序数。

戻り値

指定した列の値。

実装

IDataRecord.GetInt32

例外

例外の種類 条件
InvalidCastException 指定したキャストが有効ではありません。

解説

変換は実行されません。そのため、取得するデータは 32 ビット符号付き整数である必要があります。

このメソッドを呼び出す前に、 IsDBNull を呼び出して、null 値を確認してください。

必要条件

プラットフォーム: 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 名前空間