共用方式為


AdomdDataReader.GetChars 方法

Returns an array of Char objects that contain a stream of values from the specified column.

命名空間:  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

參數

  • ordinal
    型別:System.Int32
    The zero-based ordinal position of the column to be retrieved.
  • dataIndex
    型別:System.Int64
    The zero-based index within the column from which to begin reading data.
  • buffer
    型別:array<System.Char[]
    The buffer into which to read the stream of characters.
  • bufferIndex
    型別:System.Int32
    The zero-based index within the buffer from which to begin writing data.
  • length
    型別:System.Int32
    The number of characters to read from the column.

傳回值

型別:System.Int64
A Long that contains the number of characters actually read from the column.

實作

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

例外狀況

例外狀況 條件
System.IndexOutOfRangeException

The value ofdataIndex is greater than Int32.MaxValue.

The value of bufferIndex is less than 0 or greater than the total of length and the length of buffer.

備註

The GetChars method returns the number of available characters in the field. In most cases this is the exact length of the field. However, the number returned may be less than the true length of the field if GetChars has already been used to obtain characters from the field.

If you pass a nullnull 參考 (在 Visual Basic 中為 Nothing) reference (Nothing in Visual Basic) in the buffer parameter, GetBytes returns the length of the column in characters.

No conversions are performed; therefore the data retrieved must already be a character array.

請參閱

參考

AdomdDataReader 類別

Microsoft.AnalysisServices.AdomdClient 命名空間