Прочетете на английски Редактиране

Споделяне чрез


DataReaderExtensions.GetBytes Method

Definition

Reads a specified number of bytes from the specified column starting at a specified index and writes them to a buffer starting at a specified position in the buffer.

C#
public static long GetBytes(this System.Data.Common.DbDataReader reader, string name, long dataOffset, byte[] buffer, int bufferOffset, int length);

Parameters

reader
DbDataReader

The data reader to get the column value from.

name
String

The name of the column.

dataOffset
Int64

The index within the row from which to begin the read operation.

buffer
Byte[]

The buffer into which to copy the data.

bufferOffset
Int32

The index with the buffer to which the data will be copied.

length
Int32

The maximum number of characters to read.

Returns

The actual number of bytes read.

Exceptions

The name specified is not a valid column name.

The specified cast is not valid.

Applies to

Продукт Версии
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1

See also