# DataTableInfoCollection Class

> An instance of the DataTableInfoCollection class contains all data tables in a data source represented through objects of the type DataTableInfo. The DataTableInfoCollection class implements the interface ICollection<DocumentServer.DataSources.DataTableInfo> and therefore also IEnumerable<DocumentServer.DataSources.DataTableInfo>. This collection class is meant to be read only. For this reason all ICollection members which would cause changes to the collection content (e. g. Add(), Clear() or Remove()) throw a NotSupportedException.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **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
- **Implements:** `System.Collections.Generic.ICollection<TXTextControl.DocumentServer.DataSources.DataTableInfo>`, `System.Collections.Generic.IEnumerable<TXTextControl.DocumentServer.DataSources.DataTableInfo>`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.DataSources > DataTableInfoCollection Class
- **993 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/llms-full.txt

---

### Description

An instance of the DataTableInfoCollection class contains all data tables in a data source represented through objects of the type [DataTableInfo](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfo/llms-full.txt). The DataTableInfoCollection class implements the interface ICollection<DocumentServer.DataSources.DataTableInfo> and therefore also IEnumerable<DocumentServer.DataSources.DataTableInfo>. This collection class is meant to be read only. For this reason all ICollection members which would cause changes to the collection content (e. g. Add(), Clear() or Remove()) throw a `NotSupportedException`.

### Syntax

```csharp
public sealed class DataTableInfoCollection : ICollection<DataTableInfo>, IEnumerable<DataTableInfo>, IEnumerable
```

```vbnet
Public NotInheritable Class DataTableInfoCollection
    Implements ICollection(Of DataTableInfo), IEnumerable(Of DataTableInfo), IEnumerable
```

### Examples

The following example includes the item value from a Data Table Info Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Item: {dataTableInfoCollection["CustomerName"]}");
Console.WriteLine("Data Table Info Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Item: {dataTableInfoCollection.Item("CustomerName")}")
Console.WriteLine("Data Table Info Collection is ready for use.")
```

---

## In This Section

- [DataTableInfoCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [DataTableInfoCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/count-property/llms-full.txt): Gets the number of elements contained in the collection.
- [DataTableInfoCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/getenumerator-method/llms-full.txt): Returns an enumerator that can be used to iterate through the collection.
- [DataTableInfoCollection.IsReadOnly Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/isreadonly-property/llms-full.txt): Gets a value indicating whether the collection is read only. Always returns true.
- [DataTableInfoCollection.Item Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/item-method/llms-full.txt): Gets a DataTableInfo instance from the collection. In C# this property is the indexer for the DataTableInfoCollection class.

---

## Nearby

- **Previous:** [DataTableInfo.TableName Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfo/tablename-property/llms-full.txt)
- **Next:** [DataTableInfoCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datatableinfocollection/copyto-method/llms-full.txt)
