I load a large amount of records into my application (1 million+) and do a ton of processing on them. The processing requires them all to be in the memory.
Afterwards, I want to dump all of the (now modified) records into an empty table.
Loading the records takes mere seconds, and I end up with a large array of MyRecord
items.
Saving using SqlBulkCopy
takes mere seconds as well.
However SqlBulkCopy
requires (I believe) a DataTable
- and loading my records into a DataTable
is slow - approximately 7500 records per minute using
dataTable.Rows.Add(myRecord.Name, myRecord.Age, ....)
Is there a faster way of performing this middle step?