dataTable.Columns.AddRange in SqlServerDataSinkExtension throws an error when working with batches
Bilal-io opened this issue · 0 comments
Bilal-io commented
Description:
The method throws an error: "Error copying data to table {table_name}: Column '{column_name}' already belongs to another DataTable."
Test methods:
- The issue only occurs when dealing with batches, so that AddRange() gets called again
- I've initially encountered the issue using the pre-compiled binaries downloaded from the releases page.
- Then I cloned and built the project using VS Professional 2022
Same issue encountered with both.
System:
Windows 11 Pro 22621.1555
Potential solution:
I moved the AddRange operation outside of the batches loop, and cleared the dataTable after WriteToServerAsync