DbEnumerator 類別

定義

公開 GetEnumerator() 方法,其支援由 .NET 資料提供者對集合執行簡單的反覆運算。Exposes the GetEnumerator() method, which supports a simple iteration over a collection by a .NET data provider.

public ref class DbEnumerator : System::Collections::IEnumerator
public class DbEnumerator : System.Collections.IEnumerator
type DbEnumerator = class
    interface IEnumerator
Public Class DbEnumerator
Implements IEnumerator
繼承
DbEnumerator
實作

備註

DbEnumerator類別是由 .NET Framework 資料提供者所執行,以提供資料系結支援。The DbEnumerator class is implemented by a .NET Framework data provider to provide data binding support.

根據設計, DbEnumerator 物件僅適用于一個結果集。By design, the DbEnumerator object is intended for use with only one resultset. 例如,如果您執行的批次語句包含兩個會傳回不同架構的 SQL SELECT 語句,則第二個語句可能無法回復整個架構。For example, if you execute a batch statement containing two SQL SELECT statements that return different schemas, the second statement might not retun the entire schema. 若要避免這種情況,請 DbEnumerator 為每個結果集取得,然後呼叫 NextResult .NET Framework 資料提供者 DataReader 物件的方法。To avoid this situation, obtain a DbEnumerator for each resultset, and then call the NextResult method of a .NET Framework data provider DataReader object.

建構函式

DbEnumerator(DbDataReader)

使用指定的資料讀取器,初始化 DbEnumerator 類別的新執行個體。Initializes a new instance of the DbEnumerator class with the give n data reader.

DbEnumerator(DbDataReader, Boolean)

使用指定的讀取器初始化 DbEnumerator 類別的新執行個體,並指出是否要在逐一查看其資料之後自動關閉讀取器。Initializes a new instance of the DbEnumerator class using the specified reader and indicates whether to automatically close the reader after iterating through its data.

DbEnumerator(IDataReader)

使用指定的 DbEnumerator,初始化 DataReader 類別的新執行個體。Initializes a new instance of the DbEnumerator class using the specified DataReader.

DbEnumerator(IDataReader, Boolean)

使用指定的 DataReader 初始化 DbEnumerator 類別的新執行個體,並指出是否要在逐一查看其資料之後自動關閉 DataReaderInitializes a new instance of the DbEnumerator class using the specified DataReader, and indicates whether to automatically close the DataReader after iterating through its data.

屬性

Current

取得集合中目前的項目。Gets the current element in the collection.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MoveNext()

將列舉值往前推至下集合中的下一個項目。Advances the enumerator to the next element of the collection.

Reset()

設定列舉值至它的初始位置,這是在集合中第一個項目之前。Sets the enumerator to its initial position, which is before the first element in the collection.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於