OleDbDataReader.GetChars(Int32, Int64, Char[], Int32, Int32) Metodo

Definizione

Legge un flusso di caratteri dall'offset di colonna specificato nel buffer sotto forma di matrice, a partire dall'offset di buffer specificato.

public:
 override long GetChars(int ordinal, long dataIndex, cli::array <char> ^ buffer, int bufferIndex, int length);
public:
 virtual long GetChars(int ordinal, long dataIndex, cli::array <char> ^ buffer, int bufferIndex, int length);
public override long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length);
public override long GetChars (int ordinal, long dataIndex, char[]? buffer, int bufferIndex, int length);
public long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length);
override this.GetChars : int * int64 * char[] * int * int -> int64
abstract member GetChars : int * int64 * char[] * int * int -> int64
override this.GetChars : int * int64 * char[] * int * int -> int64
Public Overrides Function GetChars (ordinal As Integer, dataIndex As Long, buffer As Char(), bufferIndex As Integer, length As Integer) As Long
Public Function GetChars (ordinal As Integer, dataIndex As Long, buffer As Char(), bufferIndex As Integer, length As Integer) As Long

Parametri

ordinal
Int32

Ordinale di colonna in base zero.

dataIndex
Int64

Indice all'interno della riga da cui avviare l'operazione di lettura.

buffer
Char[]

Buffer in cui copiare i dati.

bufferIndex
Int32

Indice all'interno del parametro buffer dal quale iniziare l'operazione di scrittura.

length
Int32

Numero di caratteri da leggere.

Restituisce

Numero effettivo di caratteri letti.

Implementazioni

Commenti

GetChars restituisce il numero di caratteri disponibili nel campo. La maggior parte del tempo è la lunghezza esatta del campo. Tuttavia, il numero restituito può essere minore della lunghezza effettiva del campo se è già stato usato il metodo GetChars per ottenere i caratteri del campo. Questo può essere il caso, ad esempio, quando si OleDbDataReader legge una struttura di dati di grandi dimensioni in un buffer. Per altre informazioni, vedere l'impostazione SequentialAccess per CommandBehavior.

Se si passa un buffer che è null, GetChars restituisce la lunghezza del campo in caratteri.

Non vengono eseguite conversioni; pertanto, i dati recuperati devono essere già una matrice di caratteri.

Si applica a

Vedi anche