# MergeDataTable

> Merges the Destination with the Source, indicating whether to preserve changes and how to handle missing schema in the Source.

Merges the Destination with the Source, indicating whether to preserve changes and how to handle missing schema in the Source.

## Definition

**Namespace:** UiPath.Activities.System.API

**Assembly:** UiPath.System.Activities.Api (in UiPath.System.Activities.Api.dll)

## Overloads

|  |  |
| --- | --- |
| `MergeDataTable(DataTable, DataTable)` | Merges the Destination with the Source. |
| `MergeDataTable(DataTable, DataTable, MissingSchemaAction)` | Merges the Destination with the Source, indicating whether to preserve changes and how to handle missing schema in the Source. |

## `MergeDataTable(DataTable, DataTable)`

Merges the Destination with the Source.

```
void MergeDataTable(
    DataTable sourceDataTable,
    ref DataTable destinationDataTable
)
```

`sourceDataTable` [DataTable](https://learn.microsoft.com/dotnet/api/system.data.datatable) : The DataTable object to be added to the destination DataTable.

`destinationDataTable` [DataTable](https://learn.microsoft.com/dotnet/api/system.data.datatable) : The DataTable object to which the source DataTable is merged.

## `MergeDataTable(DataTable, DataTable, MissingSchemaAction)`

Merges the Destination with the Source, indicating whether to preserve changes and how to handle missing schema in the Source.

```
void MergeDataTable(
    DataTable sourceDataTable,
    ref DataTable destinationDataTable,
    MissingSchemaAction missingSchemaAction
)
```

`sourceDataTable` [DataTable](https://learn.microsoft.com/dotnet/api/system.data.datatable) : The DataTable object to be added to the destination DataTable.

`destinationDataTable` [DataTable](https://learn.microsoft.com/dotnet/api/system.data.datatable) : The DataTable object to which the source DataTable is merged.

`missingSchemaAction` [MissingSchemaAction](https://learn.microsoft.com/dotnet/api/system.data.missingschemaaction) : Specifies the action to take when merging the two DataTables. The options are:

* `Add`
* `Ignore`
* `Error`
* `AddWithKey`
