AdomdDataReader.GetChars 方法
傳回 Char 物件陣列,其中包含指定之資料行的值資料流。
命名空間: Microsoft.AnalysisServices.AdomdServer
組件: msmgdsrv (在 msmgdsrv.dll 中)
語法
'宣告
Public Function GetChars ( _
i As Integer, _
fieldOffset As Long, _
buffer As Char(), _
bufferoffset As Integer, _
length As Integer _
) As Long
'用途
Dim instance As AdomdDataReader
Dim i As Integer
Dim fieldOffset As Long
Dim buffer As Char()
Dim bufferoffset As Integer
Dim length As Integer
Dim returnValue As Long
returnValue = instance.GetChars(i, fieldOffset, _
buffer, bufferoffset, length)
public long GetChars(
int i,
long fieldOffset,
char[] buffer,
int bufferoffset,
int length
)
public:
virtual long long GetChars(
int i,
long long fieldOffset,
array<wchar_t>^ buffer,
int bufferoffset,
int length
) sealed
abstract GetChars :
i:int *
fieldOffset:int64 *
buffer:char[] *
bufferoffset:int *
length:int -> int64
override GetChars :
i:int *
fieldOffset:int64 *
buffer:char[] *
bufferoffset:int *
length:int -> int64
public final function GetChars(
i : int,
fieldOffset : long,
buffer : char[],
bufferoffset : int,
length : int
) : long
參數
- i
型別:Int32
要擷取的資料行之以零為基底序數位置。
- fieldOffset
型別:Int64
資料行中以零為基底的索引,從這裡開始讀取資料。
- buffer
型別:array<Char[]
要讀入字元資料流的緩衝區。
- bufferoffset
型別:Int32
緩衝區中以零為基底的索引,從這裡開始寫入資料。
- length
型別:Int32
要從資料行讀取的字元數。
傳回值
型別:Int64
Long ,其中包含實際從資料列讀取的字元數。
實作
IDataRecordGetChars(Int32, Int64, Char, Int32, Int32)
例外狀況
例外狀況 | 條件 |
---|---|
[IndexOutOfRangeException] | dataIndex 的值大於 Int32.MaxValue。 bufferIndex 的值小於 0 或大於 length 與 buffer 長度的總和。 如需有關此例外的詳細資訊,請參閱<IndexOutOfRangeException Class>。 |
備註
GetChars 方法會傳回欄位內可用的字元數。 在大多數情況下,這將是欄位的確切長度。 不過,如果已經使用 GetChars 從欄位取得字元,傳回的數字可能會小於欄位的實際長度。
若您經由 buffer 參數傳遞 null 參考 (在 Microsoft Visual Basic 中為 Nothing),則 GetBytes 會傳回資料行的字元數長度。
由於並未執行任何轉換,擷取的資料必須已是字元陣列。