SqlCeDataReader.GetChars 메서드

지정된 버퍼 오프셋에서 시작하는 배열로서 지정된 열 오프셋에서 버퍼로 문자의 스트림을 읽습니다.

네임스페이스:  System.Data.SqlServerCe
어셈블리:  System.Data.SqlServerCe(System.Data.SqlServerCe.dll)

구문

‘선언
<SecurityTreatAsSafeAttribute> _
<SecurityCriticalAttribute> _
Public Overrides Function GetChars ( _
    ordinal As Integer, _
    dataIndex As Long, _
    buffer As Char(), _
    bufferIndex As Integer, _
    length As Integer _
) As Long
‘사용 방법
Dim instance As SqlCeDataReader
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)
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public override long GetChars(
    int ordinal,
    long dataIndex,
    char[] buffer,
    int bufferIndex,
    int length
)
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public:
virtual long long GetChars(
    int ordinal, 
    long long dataIndex, 
    array<wchar_t>^ buffer, 
    int bufferIndex, 
    int length
) override
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
abstract GetChars : 
        ordinal:int * 
        dataIndex:int64 * 
        buffer:char[] * 
        bufferIndex:int * 
        length:int -> int64 
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
override GetChars : 
        ordinal:int * 
        dataIndex:int64 * 
        buffer:char[] * 
        bufferIndex:int * 
        length:int -> int64 
public override function GetChars(
    ordinal : int, 
    dataIndex : long, 
    buffer : char[], 
    bufferIndex : int, 
    length : int
) : long

매개 변수

  • ordinal
    유형: System.Int32
    0부터 시작하는 열 서수입니다.
  • dataIndex
    유형: System.Int64
    읽기 작업을 시작하는 행 내의 인덱스입니다.
  • buffer
    유형: array<System.Char[]
    데이터를 복사해 올 버퍼입니다.
  • bufferIndex
    유형: System.Int32
    읽기 작업을 시작할 buffer의 인덱스입니다.

반환 값

유형: System.Int64
읽은 실제 문자 수입니다.

구현

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

예외

예외 조건
InvalidOperationException

작업이 유효하지 않은 경우. SqlCeDataReader는 결과 집합의 마지막 행 뒤에 올 수 있습니다.

주의

GetChars는 필드에서 사용 가능한 문자의 수를 반환합니다. 대부분의 경우 이것은 필드의 길이에 해당합니다. 그러나 필드에서 문자를 얻는 데 GetChars가 이미 사용되었으면, 반환된 숫자가 실제 필드의 길이보다 작을 수도 있습니다. 예를 들어 SqlCeDataReader가 대량의 데이터 구조체를 버퍼로 읽을 때가 그런 경우입니다. 자세한 내용은 CommandBehavior에 대한 SequentialAccess 설정을 참조하십시오.

nullnull 참조(Visual Basic에서는 Nothing)인 버퍼를 전달하면 GetChars는 필드 길이를 문자 수 단위로 반환합니다.

변환이 수행되지 않으므로 검색하는 데이터는 이미 문자 배열이어야 합니다.

참고 항목

참조

SqlCeDataReader 클래스

System.Data.SqlServerCe 네임스페이스