# DataTableInfoCollection.GetEnumerator Method

> Returns an enumerator that can be used to iterate through the collection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.DataSources > DataTableInfoCollection.GetEnumerator Method
- **485 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/getenumerator-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/getenumerator-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/getenumerator-method/llms-full.txt

---

### Description

Returns an enumerator that can be used to iterate through the collection.

### Syntax

```csharp
public IEnumerator<DataTableInfo> GetEnumerator();
```

```vbnet
Public Function GetEnumerator() As IEnumerator(Of DataTableInfo)
```

### Return Value

The return value is an IEnumerator that represents the collection.

### Examples

The following example obtains an enumerator and visits each data table info in the collection.

```csharp
IEnumerator enumerator = dataTableInfoCollection.GetEnumerator();

while (enumerator.MoveNext())
{
    TXTextControl.DocumentServer.DataSources.DataTableInfo dataTableInfo = (TXTextControl.DocumentServer.DataSources.DataTableInfo)enumerator.Current;
    Console.WriteLine(dataTableInfo);
}
```

```vbnet
Dim enumerator As IEnumerator = dataTableInfoCollection.GetEnumerator()

While enumerator.MoveNext()
    Dim dataTableInfo As TXTextControl.DocumentServer.DataSources.DataTableInfo =
        DirectCast(enumerator.Current, TXTextControl.DocumentServer.DataSources.DataTableInfo)
    Console.WriteLine(dataTableInfo)
End While
```

---

## Nearby

- **Previous:** [DataTableInfoCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/count-property/llms-full.txt)
- **Next:** [DataTableInfoCollection.IsReadOnly Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/isreadonly-property/llms-full.txt)
