# DataRelationInfoCollection.Count Property

> Gets the number of elements contained in the collection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **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 > DataRelationInfoCollection.Count Property
- **304 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/count-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/count-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/count-property/llms-full.txt

---

### Description

Gets the number of elements contained in the collection.

### Syntax

```csharp
public int Count { get; }
```

```vbnet
Public ReadOnly Property Count As Integer
```

### Examples

The following example includes the count value in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Count: {dataRelationInfoCollection.Count}");
Console.WriteLine("Data Relation Info Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Count: {dataRelationInfoCollection.Count}")
Console.WriteLine("Data Relation Info Collection is ready for use.")
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [DataRelationInfoCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/copyto-method/llms-full.txt)
- **Next:** [DataRelationInfoCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/datarelationinfocollection/getenumerator-method/llms-full.txt)
