DbDataReader.GetStream(Int32) DbDataReader.GetStream(Int32) DbDataReader.GetStream(Int32) DbDataReader.GetStream(Int32) Method

定义

获取从指定列检索数据的流。Gets a stream to retrieve data from the specified column.

public:
 virtual System::IO::Stream ^ GetStream(int ordinal);
public virtual System.IO.Stream GetStream (int ordinal);
abstract member GetStream : int -> System.IO.Stream
override this.GetStream : int -> System.IO.Stream
Public Overridable Function GetStream (ordinal As Integer) As Stream

参数

ordinal
Int32 Int32 Int32 Int32

从零开始的列序号。The zero-based column ordinal.

返回

一个流。A stream.

异常

在数据检索期间删除或关闭连接。The connection was dropped or closed during the data retrieval.

- 或 --or-

在数据检索期间关闭数据读取器。The data reader is closed during the data retrieval.

- 或 --or-

没有要读取的就绪数据 (例如,第一个 Read() 未被调用或返回错误)。There is no data ready to be read (for example, the first Read() hasn't been called, or returned false).

-or-

数据读取器按顺序模式尝试读取上一步骤中读取的列。The data reader tried to read a previously-read column in sequential mode.

-or-

没有正在进行的异步操作。There was an asynchronous operation in progress. 以顺序模式运行时,这适用于所有 Get* 方法,读取流时也可对其进行调用。This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream.

指定的列不是支持用 Stream 读取的二进制类型。The specified column isn't a binary type that supports reading with a Stream.

注解

GetStream仅支持检索可转换为字节数组的值。GetStream only supports the retrieval of values that can be converted to byte arrays.

适用于