OleDbDataReader.GetEnumerator 方法

定义

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

public:
 override System::Collections::IEnumerator ^ GetEnumerator();
public override System.Collections.IEnumerator GetEnumerator ();
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Overrides Function GetEnumerator () As IEnumerator

返回

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

注解

尽管可以使用此方法来检索显式枚举器,但在支持foreach构造的语言中,直接使用循环构造来循环访问数据读取器中的行更为简单。Although you can use this method to retrieve an explicit enumerator, in languages that support a foreach construct, it is simpler to use the looping construct directly in order to iterate through the rows in the data reader.

适用于

另请参阅