# DataColumnInfoCollection.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 > DataColumnInfoCollection.GetEnumerator Method
- **488 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/getenumerator-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/getenumerator-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/getenumerator-method/llms-full.txt

---

### Description

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

### Syntax

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

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

### Return Value

The return value is an IEnumerator that represents the collection.

### Examples

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

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

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

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

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

---

## Nearby

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