# DataColumnInfoCollection Class

> An instance of the DataColumnInfoCollection class contains all data columns of a data table in a data source represented through objects of the type DataColumnInfo. The DataColumnInfoCollection class implements the interface ICollection<DocumentServer.DataSources.DataColumnInfo> and therefore also IEnumerable<DocumentServer.DataSources.DataColumnInfo>. 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 Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDocumentServer.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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.DataColumnInfo>`, `System.Collections.Generic.IEnumerable<TXTextControl.DocumentServer.DataSources.DataColumnInfo>`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.DataSources > DataColumnInfoCollection Class
- **994 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/llms-full.txt

---

### Description

An instance of the DataColumnInfoCollection class contains all data columns of a data table in a data source represented through objects of the type [DataColumnInfo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfo/llms-full.txt). The DataColumnInfoCollection class implements the interface ICollection<DocumentServer.DataSources.DataColumnInfo> and therefore also IEnumerable<DocumentServer.DataSources.DataColumnInfo>. 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 DataColumnInfoCollection : ICollection<DataColumnInfo>, IEnumerable<DataColumnInfo>, IEnumerable
```

```vbnet
Public NotInheritable Class DataColumnInfoCollection
    Implements ICollection(Of DataColumnInfo), IEnumerable(Of DataColumnInfo), IEnumerable
```

### Examples

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

```csharp
Console.WriteLine($"Item: {dataColumnInfoCollection[1]}");
Console.WriteLine("Data Column Info Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Item: {dataColumnInfoCollection.Item(1)}")
Console.WriteLine("Data Column Info Collection is ready for use.")
```

---

## In This Section

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

---

## Nearby

- **Previous:** [DataColumnInfo.DataType Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfo/datatype-property/llms-full.txt)
- **Next:** [DataColumnInfoCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datacolumninfocollection/copyto-method/llms-full.txt)
