# DocumentController.FieldAdapterCollection.CopyTo Method

> Copies the elements of the collection to an array, starting at the specified index.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **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 > DocumentController.FieldAdapterCollection.CopyTo Method
- **499 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/copyto-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/copyto-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/copyto-method/llms-full.txt

---

### Description

Copies the elements of the collection to an array, starting at the specified index.

### Syntax

```csharp
public void CopyTo(Array array, int index);
```

```vbnet
Public Sub CopyTo(array As Array, index As Integer)
```

### Parameters

| Parameter | Description |
|---|---|
| array | Specifies the array to copy to. |
| index | Specifies the index of the destination array at which to begin copying. |

### Examples

The following example copies the field adapter collection into a strongly typed array.

```csharp
TXTextControl.DocumentServer.Fields.FieldAdapter[] items = new TXTextControl.DocumentServer.Fields.FieldAdapter[fieldAdapterCollection.Count];
fieldAdapterCollection.CopyTo(items, 0);
```

```vbnet
If fieldAdapterCollection.Count > 0 Then
    Dim items(fieldAdapterCollection.Count - 1) As TXTextControl.DocumentServer.Fields.FieldAdapter
    fieldAdapterCollection.CopyTo(items, 0)
End If
```

---

## Nearby

- **Previous:** [DocumentController.FieldAdapterCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/llms-full.txt)
- **Next:** [DocumentController.FieldAdapterCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/count-property/llms-full.txt)
