DbDataReader.GetEnumerator Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, returns an enumerator that can be used to iterate through the rows in the data reader.
public:
abstract System::Collections::IEnumerator ^ GetEnumerator();
public abstract System.Collections.IEnumerator GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.IEnumerator
Public MustOverride Function GetEnumerator () As IEnumerator
Returns
An enumerator that can be used to iterate through the rows in the data reader.
Implements
Remarks
Although you can use this method to retrieve an explicit constructor, in languages that support an explicit foreach construct, it is simpler to use the looping construct directly in order to iterate through the rows in the data reader.
If you implement this method, it should return a new instance of DbEnumerator or ensure that your enumerator returns IDataRecord objects.