DbDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32) 方法

定義

當在派生類別中被覆寫時,會從指定欄位(從指定索引開始)讀取指定數量的位元組,並將其寫入從緩衝區指定位置開始的緩衝區。

public:
 abstract long GetBytes(int ordinal, long dataOffset, cli::array <System::Byte> ^ buffer, int bufferOffset, int length);
public abstract long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length);
public abstract long GetBytes(int ordinal, long dataOffset, byte[]? buffer, int bufferOffset, int length);
abstract member GetBytes : int * int64 * byte[] * int * int -> int64
Public MustOverride Function GetBytes (ordinal As Integer, dataOffset As Long, buffer As Byte(), bufferOffset As Integer, length As Integer) As Long

參數

ordinal
Int32

零基列序數。

dataOffset
Int64

讀取操作從該列開始的索引。

buffer
Byte[]

就是用來複製資料的緩衝區。

bufferOffset
Int32

索引中資料將被複製的緩衝區。

length
Int32

最大可讀取的位元組數。

傳回

實際讀取的位元組數。

實作

例外狀況

欄位索引超出範圍。

指定的鑄造組合不成立。

適用於

另請參閱