OracleDataReader 类

定义

提供从数据源读取数据行的只进流的方法。Provides a way of reading a forward-only stream of data rows from a data source. 此类不能被继承。This class cannot be inherited.

public ref class OracleDataReader sealed : MarshalByRefObject, IDisposable, System::Collections::IEnumerable, System::Data::IDataReader
public ref class OracleDataReader sealed : System::Data::Common::DbDataReader
public sealed class OracleDataReader : MarshalByRefObject, IDisposable, System.Collections.IEnumerable, System.Data.IDataReader
public sealed class OracleDataReader : System.Data.Common.DbDataReader
type OracleDataReader = class
    inherit MarshalByRefObject
    interface IDataReader
    interface IDisposable
    interface IDataRecord
    interface IEnumerable
type OracleDataReader = class
    inherit DbDataReader
Public NotInheritable Class OracleDataReader
Inherits MarshalByRefObject
Implements IDataReader, IDisposable, IEnumerable
Public NotInheritable Class OracleDataReader
Inherits DbDataReader
继承
OracleDataReader
继承
实现

示例

下面的示例创建一个 OracleConnection 、一个 OracleCommand 和一个 OracleDataReaderThe following example creates an OracleConnection, an OracleCommand, and an OracleDataReader. 该示例将读取数据,并将其写出到控制台。The example reads through the data, writing it out to the console. 最后,该示例关闭 OracleDataReader ,然后关闭 OracleConnectionFinally, the example closes the OracleDataReader, then the OracleConnection.

public void ReadData(string connectionString)
{
   string queryString = "SELECT EmpNo, EName FROM Emp";
   using (OracleConnection connection = new OracleConnection(connectionString))
   {
      OracleCommand command = new OracleCommand(queryString, connection);
      connection.Open();
      using(OracleDataReader reader = command.ExecuteReader())
      {
         // Always call Read before accessing data.
         while (reader.Read())
         {
            Console.WriteLine(reader.GetInt32(0) + ", " + reader.GetString(1));
         }
      }
   }
}
Public Sub ReadData(ByVal connectionString As String)
    Dim queryString As String = "SELECT EmpNo, EName FROM Emp"
    Using connection As New OracleConnection(connectionString)
        Dim command As New OracleCommand(queryString, connection)
        connection.Open()
        Using reader As OracleDataReader = command.ExecuteReader()
            ' Always call Read before accessing data.
            While reader.Read()
                Console.WriteLine(reader.GetInt32(0).ToString() + ", " _
                   + reader.GetString(1))
            End While
        End Using
    End Using
End Sub

注解

若要创建 OracleDataReader ,必须调用对象的 ExecuteReader 方法 OracleCommand ,而不是直接使用构造函数。To create an OracleDataReader, you must call the ExecuteReader method of the OracleCommand object, rather than directly using a constructor.

在读取数据时,由其他进程或线程对结果集所做的更改可能对的用户可见 OracleDataReaderChanges made to a resultset by another process or thread while data is being read may be visible to the user of the OracleDataReader.

IsClosedRecordsAffected 是在关闭 OracleDataReader 后可以调用的唯一属性。IsClosed and RecordsAffected are the only properties that you can call after the OracleDataReader is closed. 在某些情况下,必须先调用, Close 然后才能调用 RecordsAffectedIn some cases, you must call Close before you can call RecordsAffected.

OracleDataReader在任意给定时间,都可以打开多个。More than one OracleDataReader can be open at any given time.

下面两个 Visual Basic 示例演示如何使用 OracleDataReader 来检索 Oracle REF CURSORThe following two Visual Basic examples demonstrate how to use an OracleDataReader to retrieve an Oracle REF CURSOR. 这些示例使用 Oracle Scott/Tiger 架构中定义的表,并且需要以下 PL/SQL 包和包正文。These examples use tables that are defined in the Oracle Scott/Tiger schema, and require the following PL/SQL package and package body. 你必须在服务器上创建它们以使用这些示例。You must create these on your server to use the examples.

在 Oracle 服务器上创建以下 Oracle 包。Create the following Oracle package on the Oracle server.

CREATE OR REPLACE PACKAGE CURSPKG AS   
   TYPE T_CURSOR IS REF CURSOR;   
   PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,   
      IO_CURSOR IN OUT T_CURSOR);   
   PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,   
      DEPTCURSOR OUT T_CURSOR);  
END CURSPKG;  
/  

在 Oracle 服务器上创建下面的 Oracle 包正文。Create the following Oracle package body on the Oracle server.

CREATE OR REPLACE PACKAGE BODY CURSPKG AS   
    PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,   
                               IO_CURSOR OUT T_CURSOR)   
    IS   
        V_CURSOR T_CURSOR;   
    BEGIN   
        IF N_EMPNO <> 0 THEN   
             OPEN V_CURSOR FOR   
             SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME   
                  FROM EMP, DEPT   
                  WHERE EMP.DEPTNO = DEPT.DEPTNO   
                        AND EMP.EMPNO = N_EMPNO;   
        ELSE   
             OPEN V_CURSOR FOR   
             SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME   
                  FROM EMP, DEPT   
                  WHERE EMP.DEPTNO = DEPT.DEPTNO;   
        END IF;   
        IO_CURSOR := V_CURSOR;   
    END OPEN_ONE_CURSOR;   
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,   
                                DEPTCURSOR OUT T_CURSOR)   
    IS   
        V_CURSOR1 T_CURSOR;   
        V_CURSOR2 T_CURSOR;   
    BEGIN   
        OPEN V_CURSOR1 FOR SELECT * FROM EMP;   
        OPEN V_CURSOR2 FOR SELECT * FROM DEPT;   
        EMPCURSOR  := V_CURSOR1;   
        DEPTCURSOR := V_CURSOR2;   
    END OPEN_TWO_CURSORS;   
END CURSPKG;  
/  

此 Visual Basic 示例执行一个 PL/SQL 存储过程,该存储过程返回一个 REF CURSOR 参数,并将值作为读取 OracleDataReaderThis Visual Basic example executes a PL/SQL stored procedure that returns a REF CURSOR parameter, and reads the value as an OracleDataReader.

Private Sub ReadOracleData(ByVal connectionString As String)  
   Dim connection As New OracleConnection(connectionString)  
   Dim command As New OracleCommand()  
   Dim reader As OracleDataReader  

   connection.Open()  
   command.Connection = connection  
   command.CommandText = "CURSPKG.OPEN_ONE_CURSOR"  
   command.CommandType = CommandType.StoredProcedure  
   command.Parameters.Add(New OracleParameter("N_EMPNO", OracleType.Number)).Value = 7369  
   command.Parameters.Add(New OracleParameter("IO_CURSOR", OracleType.Cursor)).Direction = ParameterDirection.Output  

   reader = command.ExecuteReader()  
   While (reader.Read())  
      ' Do something with the values.  
   End While  
   reader.Close()  
   connection.Close()  
End Sub  

此 Visual Basic 示例执行一个 PL/SQL 存储过程,该存储过程返回两个 REF CURSOR 参数,并使用读取值 OracleDataReaderThis Visual Basic example executes a PL/SQL stored procedure that returns two REF CURSOR parameters, and reads the values using an OracleDataReader.

Private Sub ReadOracleData(ByVal connectionString As String)  
   Dim dataSet As New DataSet()  
   Dim connection As New OracleConnection(connectionString)  
   Dim command As New OracleCommand()  
   Dim reader As OracleDataReader  

   connection.Open()  
   command.Connection = connection  
   command.CommandText = "CURSPKG.OPEN_TWO_CURSORS"  
   command.CommandType = CommandType.StoredProcedure  
   command.Parameters.Add(New OracleParameter("EMPCURSOR", OracleType.Cursor)).Direction = ParameterDirection.Output  
   command.Parameters.Add(New OracleParameter("DEPTCURSOR", OracleType.Cursor)).Direction = ParameterDirection.Output  

   reader = command.ExecuteReader(CommandBehavior.CloseConnection)  
   While (reader.Read())  
      ' Do something with the values.  
   End While  
   reader.NextResult()  
   While (reader.Read())  
        ' Do something with the values.  
   End While  
   reader.Close()  
   connection.Close()  
 End Sub  

此 c # 示例创建一个 Oracle 表并将其与数据一起加载。This C# example creates an Oracle table and loads it with data. 必须先运行此示例,然后再运行后面的示例,该示例演示 OracleDataReader 如何使用来访问使用 OracleType 结构的数据。You must run this example prior to running the subsequent example, which demonstrates using an OracleDataReader to access the data using OracleType structures.

public void Setup(string connectionString)  
{  
   OracleConnection connection = new OracleConnection(connectionString);  
   try  
   {  
      connection.Open();  
      OracleCommand command = connection.CreateCommand();  
      command.CommandText ="CREATE TABLE OracleTypesTable (MyVarchar2 varchar2(3000),MyNumber number(28,4) PRIMARY KEY,MyDate date, MyRaw raw(255))";  
      command.ExecuteNonQuery();  
      command.CommandText ="INSERT INTO OracleTypesTable VALUES ('test', 2, to_date('2000-01-11 12:54:01','yyyy-mm-dd hh24:mi:ss'), '0001020304')";  
      command.ExecuteNonQuery();  
      command.CommandText="SELECT * FROM OracleTypesTable";  
   }  
   catch(Exception)  
   {  
   }  
   finally  
   {  
      connection.Close();  
   }  
}  

此 c # 示例使用 OracleDataReader 来访问数据,并使用多个 OracleType 结构来显示数据。This C# example uses an OracleDataReader to access data, and uses several OracleType structures to display the data.

public void ReadOracleTypesExample(string connectionString)  
{  
   OracleConnection connection = new OracleConnection(connectionString);  
   connection.Open();  
   OracleCommand command = connection.CreateCommand();  
   try  
   {  
      command.CommandText = "SELECT * FROM OracleTypesTable";  
      OracleDataReader reader = command.ExecuteReader();  
      reader.Read();  
      //Using the Oracle specific getters for each type is faster than  
      //using GetOracleValue.  
      //First column, MyVarchar2, is a VARCHAR2 data type in Oracle Server  
      //and maps to OracleString.  
      OracleString oraclestring1 = reader.GetOracleString(0);  
      Console.WriteLine("OracleString " + oraclestring1.ToString());  

      //Second column, MyNumber, is a NUMBER data type in Oracle Server  
      //and maps to OracleNumber.  
      OracleNumber oraclenumber1 = reader.GetOracleNumber(1);  
      Console.WriteLine("OracleNumber " + oraclenumber1.ToString());  

      //Third column, MyDate, is a DATA data type in Oracle Server  
      //and maps to OracleDateTime.  
      OracleDateTime oracledatetime1 = reader.GetOracleDateTime(2);  
      Console.WriteLine("OracleDateTime " + oracledatetime1.ToString());  

      //Fourth column, MyRaw, is a RAW data type in Oracle Server and  
      //maps to OracleBinary.  
      OracleBinary oraclebinary1 = reader.GetOracleBinary(3);  

      //Calling value on a null OracleBinary throws  
      //OracleNullValueException; therefore, check for a null value.  
      if (oraclebinary1.IsNull==false)  
      {  
         foreach(byte b in oraclebinary1.Value)  
         {  
            Console.WriteLine("byte " + b.ToString());  
         }  
      }  
      reader.Close();  
   }  
   catch(Exception e)  
   {  
      Console.WriteLine(e.ToString());  
   }  
   finally  
   {  
      connection.Close();  
   }  
}  

属性

Depth

获取一个值,该值指示当前行的嵌套深度。Gets a value indicating the depth of nesting for the current row.

FieldCount

获取当前行中的列数。Gets the number of columns in the current row.

HasRows

获取一个值,该值指示 OracleDataReader 是否包含一行或多行。Gets a value indicating whether the OracleDataReader contains one or more rows.

IsClosed

指示 OracleDataReader 是否关闭。Indicates whether the OracleDataReader is closed.

Item[Int32]

在给定列序号的情况下,获取指定列的以本机格式表示的值。Gets the value of the specified column in its native format given the column ordinal.

Item[String]

在给定列名称的情况下,获取指定列的以本机格式表示的值。Gets the value of the specified column in its native format given the column name.

RecordsAffected

通过执行 SQL 语句获取更改、插入或删除的行数。Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

VisibleFieldCount

获取 DbDataReader 中未隐藏的字段的数目。Gets the number of fields in the DbDataReader that are not hidden.

(继承自 DbDataReader)

方法

Close()

关闭 OracleDataReader 对象。Closes the OracleDataReader object.

CloseAsync()

异步关闭 DbDataReader 对象。Asynchronously closes the DbDataReader object.

(继承自 DbDataReader)
CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Dispose()

释放此对象使用的资源。Releases the resources that are used by this object.

Dispose()

释放 DbDataReader 类的当前实例所使用的所有资源。Releases all resources used by the current instance of the DbDataReader class.

(继承自 DbDataReader)
Dispose(Boolean)

释放由 DbDataReader 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the DbDataReader and optionally releases the managed resources.

(继承自 DbDataReader)
DisposeAsync()

异步释放 DbDataReader 类的当前实例所使用的所有资源。Asynchronously releases all resources used by the current instance of the DbDataReader class.

(继承自 DbDataReader)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetBoolean(Int32)

获取指定列的布尔值形式的值。Gets the value of the specified column as a Boolean.

GetByte(Int32)

以字节的形式获取指定列的值。Gets the value of the specified column as a byte.

GetBytes(Int32, Int64, Byte[], Int32, Int32)

将字节流从指定列偏移量读入到缓冲区中,将其作为从给定缓冲区偏移量开始的数组。Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.

GetChar(Int32)

获取指定列的字符形式的值。Gets the value of the specified column as a character.

GetChars(Int32, Int64, Char[], Int32, Int32)

将字符流从指定列偏移量读入到缓冲区中,将其作为从给定缓冲区偏移量开始的数组。Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.

GetColumnSchemaAsync(CancellationToken)

这是 GetColumnSchema(DbDataReader) 的异步版本。This is the asynchronous version of GetColumnSchema(DbDataReader). 提供程序应使用合适的实现进行重写。Providers should override with an appropriate implementation. 可以选择接受 cancellationTokenThe cancellationToken can optionally be honored. 默认实现调用同步 GetColumnSchema(DbDataReader) 调用并返回已完成任务。The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task. 如果传递到已取消 cancellationToken,则默认实现将返回已取消的任务。The default implementation will return a cancelled task if passed an already cancelled cancellationToken. GetColumnSchema(DbDataReader) 引发的异常将通过任务异常属性传递。Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.

(继承自 DbDataReader)
GetData(Int32)

返回指定列序号的 IDataReaderReturns an IDataReader for the specified column ordinal.

GetData(Int32)

返回所请求列的嵌套数据读取器。Returns a nested data reader for the requested column.

(继承自 DbDataReader)
GetDataTypeName(Int32)

获取源数据类型的名称。Gets the name of the source data type.

GetDateTime(Int32)

DateTime 对象的形式获取指定列的值。Gets the value of the specified column as a DateTime object.

GetDbDataReader(Int32)

返回被请求的列序号的 DbDataReader 对象,可以使用提供程序特定的实现对该对象进行重写。Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.

(继承自 DbDataReader)
GetDecimal(Int32)

Decimal 对象的形式获取指定列的值。Gets the value of the specified column as a Decimal object.

GetDouble(Int32)

获取作为双精度浮点数的指定列的值。Gets the value of the specified column as a double-precision floating point number.

GetEnumerator()

返回一个可用于循环访问数据读取器中的行的 IEnumeratorReturns an IEnumerator that can be used to iterate through the rows in the data reader.

GetFieldType(Int32)

获取作为对象的数据类型的 TypeGets the Type that is the data type of the object.

GetFieldValue<T>(Int32)

获取指定列的值作为请求的类型。Gets the value of the specified column as the requested type.

(继承自 DbDataReader)
GetFieldValueAsync<T>(Int32)

异步获取指定列的值作为请求的类型。Asynchronously gets the value of the specified column as the requested type.

(继承自 DbDataReader)
GetFieldValueAsync<T>(Int32, CancellationToken)

异步获取指定列的值作为请求的类型。Asynchronously gets the value of the specified column as the requested type.

(继承自 DbDataReader)
GetFloat(Int32)

获取指定列的单精度浮点数形式的值。Gets the value of the specified column as a single-precision floating-point number.

GetGuid(Int32)

以全局唯一标识符 (GUID) 的形式获取指定列的值。Gets the value of the specified column as a globally-unique identifier (GUID).

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetInt16(Int32)

获取指定列的 16 位有符号整数形式的值。Gets the value of the specified column as a 16-bit signed integer.

GetInt32(Int32)

获取指定列的 32 位带符号整数形式的值。Gets the value of the specified column as a 32-bit signed integer.

GetInt64(Int32)

以 64 位有符号整数的形式获取指定列的值。Gets the value of the specified column as a 64-bit signed integer.

GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetName(Int32)

获取指定列的名称。Gets the name of the specified column.

GetOracleBFile(Int32)

获取指定列的 OracleBFile 对象形式的值。Gets the value of the specified column as an OracleBFile object.

GetOracleBinary(Int32)

获取指定列的 OracleBinary 对象形式的值。Gets the value of the specified column as an OracleBinary object.

GetOracleDateTime(Int32)

获取指定列的 OracleDateTime 对象形式的值。Gets the value of the specified column as an OracleDateTime object.

GetOracleLob(Int32)

获取指定列的 OracleLob 对象形式的值。Gets the value of the specified column as an OracleLob object.

GetOracleMonthSpan(Int32)

获取指定列的 OracleMonthSpan 对象形式的值。Gets the value of the specified column as an OracleMonthSpan object.

GetOracleNumber(Int32)

获取指定列的 OracleNumber 对象形式的值。Gets the value of the specified column as an OracleNumber object.

GetOracleString(Int32)

获取指定列的 OracleString 对象形式的值。Gets the value of the specified column as an OracleString object.

GetOracleTimeSpan(Int32)

获取指定列的 OracleTimeSpan 对象形式的值。Gets the value of the specified column as an OracleTimeSpan object.

GetOracleValue(Int32)

获取以 Oracle 格式表示的指定序号处的列的值。Gets the value of the column at the specified ordinal in its Oracle format.

GetOracleValues(Object[])

获取以 Oracle 格式表示的当前行中所有的特性列。Gets all the attribute columns in the current row in Oracle format.

GetOrdinal(String)

在给定列名时获取相应的列序号。Gets the column ordinal, given the name of the column.

GetProviderSpecificFieldType(Int32)

获取一个 Object,该对象表示特定于基础提供程序的字段类型。Gets an Object that is a representation of the underlying provider specific field type.

GetProviderSpecificValue(Int32)

获取一个 Object,该对象表示特定于基础提供程序的字段类型。Gets an Object that is a representation of the underlying provider specific field type.

GetProviderSpecificValues(Object[])

获取表示基础提供程序特定值的对象的数组。Gets an array of objects that are a representation of the underlying provider specific values.

GetSchemaTable()

返回一个 DataTable,它描述 OracleDataReader 的列元数据。Returns a DataTable that describes the column metadata of the OracleDataReader.

GetSchemaTableAsync(CancellationToken)

这是 GetSchemaTable() 的异步版本。This is the asynchronous version of GetSchemaTable(). 提供程序应使用合适的实现进行重写。Providers should override with an appropriate implementation. 可以选择接受 cancellationTokenThe cancellationToken can optionally be honored. 默认实现调用同步 GetSchemaTable() 调用并返回已完成任务。The default implementation invokes the synchronous GetSchemaTable() call and returns a completed task. 如果传递到已取消 cancellationToken,则默认实现将返回已取消的任务。The default implementation will return a cancelled task if passed an already cancelled cancellationToken. GetSchemaTable() 引发的异常将通过任务异常属性传递。Exceptions thrown by GetSchemaTable() will be communicated via the returned Task Exception property.

(继承自 DbDataReader)
GetStream(Int32)

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

(继承自 DbDataReader)
GetString(Int32)

获取指定列的字符串形式的值。Gets the value of the specified column as a string.

GetTextReader(Int32)

获取文本读取器以从列中检索数据。Gets a text reader to retrieve data from the column.

(继承自 DbDataReader)
GetTimeSpan(Int32)

获取指定列的 System.TimeSpan 形式的值。Gets the value of the specified column as a System.TimeSpan.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetValue(Int32)

获取以本机格式表示的指定序号处的列的值。Gets the value of the column at the specified ordinal in its native format.

GetValues(Object[])

使用当前行的列值来填充对象数组。Populates an array of objects with the column values of the current row.

InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
IsDBNull(Int32)

获取一个值,该值指示列中是否包含不存在的或缺少的值。Gets a value indicating whether the column contains non-existent or missing values.

IsDBNullAsync(Int32)

异步获取一个值,该值指示列中是否包含不存在的或缺少的值。Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(继承自 DbDataReader)
IsDBNullAsync(Int32, CancellationToken)

异步获取一个值,该值指示列中是否包含不存在的或缺少的值。Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(继承自 DbDataReader)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
NextResult()

使 OracleDataReader 前进到下一个结果。Advances the OracleDataReader to the next result.

NextResultAsync()

在读取一批语句的结果时,使读取器异步前进到下一个结果。Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(继承自 DbDataReader)
NextResultAsync(CancellationToken)

在读取一批语句的结果时,使读取器异步前进到下一个结果。Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(继承自 DbDataReader)
Read()

OracleDataReader 前进到下一条记录。Advances the OracleDataReader to the next record.

ReadAsync()

使读取器异步前进到结果集中的下一条记录。Asynchronously advances the reader to the next record in a result set.

(继承自 DbDataReader)
ReadAsync(CancellationToken)

使读取器异步前进到结果集中的下一条记录。Asynchronously advances the reader to the next record in a result set.

(继承自 DbDataReader)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

IDataReader.Close()

有关此成员的说明,请参见 Close()For a description of this member, see Close().

(继承自 DbDataReader)
IDataReader.GetSchemaTable()

有关此成员的说明,请参见 GetSchemaTable()For a description of this member, see GetSchemaTable().

(继承自 DbDataReader)
IDataRecord.GetData(Int32)

有关此成员的说明,请参见 GetData(Int32)For a description of this member, see GetData(Int32).

(继承自 DbDataReader)
IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

扩展方法

CanGetColumnSchema(DbDataReader)

获取一个值,指示 DbDataReader 是否可以获取列架构。Gets a value that indicates whether a DbDataReader can get a column schema.

GetColumnSchema(DbDataReader)

获取 DbDataReader 的列架构(DbColumn 集合)。Gets the column schema (DbColumn collection) for a DbDataReader.

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于