次の方法で共有


GetChars メソッド

指定された列の値のストリームを示す Char オブジェクトの配列を返します。

名前空間:  Microsoft.AnalysisServices.AdomdClient
アセンブリ:  Microsoft.AnalysisServices.AdomdClient (Microsoft.AnalysisServices.AdomdClient.dll)

構文

'宣言
Public Function GetChars ( _
    ordinal As Integer, _
    dataIndex As Long, _
    buffer As Char(), _
    bufferIndex As Integer, _
    length As Integer _
) As Long
'使用
Dim instance As AdomdDataReader
Dim ordinal As Integer
Dim dataIndex As Long
Dim buffer As Char()
Dim bufferIndex As Integer
Dim length As Integer
Dim returnValue As Long

returnValue = instance.GetChars(ordinal, _
    dataIndex, buffer, bufferIndex, length)
public long GetChars(
    int ordinal,
    long dataIndex,
    char[] buffer,
    int bufferIndex,
    int length
)
public:
virtual long long GetChars(
    int ordinal, 
    long long dataIndex, 
    array<wchar_t>^ buffer, 
    int bufferIndex, 
    int length
) sealed
abstract GetChars : 
        ordinal:int * 
        dataIndex:int64 * 
        buffer:char[] * 
        bufferIndex:int * 
        length:int -> int64 
override GetChars : 
        ordinal:int * 
        dataIndex:int64 * 
        buffer:char[] * 
        bufferIndex:int * 
        length:int -> int64 
public final function GetChars(
    ordinal : int, 
    dataIndex : long, 
    buffer : char[], 
    bufferIndex : int, 
    length : int
) : long

パラメーター

  • dataIndex
    型: System. . :: . .Int64
    データの読み取りを開始する列内の 0 から始まるインデックスです。
  • buffer
    型: array<System. . :: . .Char> [] () [] []
    文字ストリームを読み取るバッファです。
  • bufferIndex
    型: System. . :: . .Int32
    データの書き込みを開始するバッファ内の 0 から始まるインデックスです。

戻り値

型: System. . :: . .Int64
列から実際に読み取る文字数を表す Long です。

実装

IDataRecord. . :: . .GetChars(Int32, Int64, array<Char> [] () [] [], Int32, Int32)

例外

例外 条件
System..::..IndexOutOfRangeException

dataIndex の値が Int32.MaxValue より大きくなっています。

bufferIndex の値が 0 より小さいか、または length と buffer の長さの合計より大きくなっています。

説明

GetChars メソッドは、フィールドで使用できる文字数を返します。多くの場合、これはフィールドの正確な長さになります。ただし、既に GetChars を使用してフィールドから文字を取得している場合、返される文字数はフィールドの正しい長さよりも少なくなる場合があります。

buffer パラメータに NULL 参照 (Visual Basic では Nothing) を渡すと、GetBytes は、列の長さを文字数で返します。

変換は行われないため、取得するデータは既に文字列配列になっている必要があります。