メモ : この名前空間、クラス、およびメンバは、.NET Framework Version 1.1 だけでサポートされています。
指定したバッファ オフセットを開始位置として、指定した列オフセットからバッファに、バイトのストリームを配列として読み込みます。
Public Overridable Function GetBytes( _
ByVal i As Integer, _ ByVal dataIndex As Long, _ ByVal buffer() As Byte, _ ByVal bufferIndex As Integer, _ ByVal length As Integer _) As Long Implements IDataRecord.GetBytes
[C#]
public virtual long GetBytes(inti,longdataIndex,byte[] buffer,intbufferIndex,intlength);
[C++]
public: virtual __int64 GetBytes(inti,__int64dataIndex,unsigned charbuffer __gc[],intbufferIndex,intlength);
[JScript]
public function GetBytes(
i : int,dataIndex : long,buffer : Byte[],bufferIndex : int,length : int) : long;
パラメータ
- i
列の 0 から始まる序数。 - dataIndex
読み込みを開始するフィールド内のインデックス。 - buffer
バイト ストリームの読み込み先のバッファ。 - bufferIndex
buffer が書き込み操作を開始するインデックス。 - length
読み込むバイト数。
戻り値
実際に読み込まれたバイト数。
実装
解説
GetBytes は、フィールド内の利用可能なバイト数を返します。ほとんどの場合、これは正確なフィールド長です。ただし、既に GetBytes を使用してフィールドからバイトを取得している場合は、返されるバイト数がフィールドの実際の長さよりも小さくなることがあります。これは、 OdbcDataReader が大きいデータ構造体をバッファに読み込んでいるときなどに起こります。詳細については、 CommandBehavior の SequentialAccess 設定のトピックを参照してください。
null 値のバッファを渡すと、 GetBytes は、バイト単位のフィールド長を返します。
変換は、基になっている ODBC ドライバの機能に基づいて実行されます。変換がサポートされていない場合、このメソッド呼び出しは失敗します。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
OdbcDataReader クラス | OdbcDataReader メンバ | System.Data.Odbc 名前空間