How using ClosedXML library in fastest way (from performance point of view) add values from DataTable
to already existing Excel worksheet?
NOTE: There is way to create new worksheet with DataTable
parameter, but the main issue is in adding values to existing worksheet.
If you're dealing with millions of cells and you want to insert the data as fast as possible while consuming the minimum amount of memory then SAX is the way to go.
If you want ClosedXML to do the work for you then use:
cell.Value = dataTable; or cell.SetValue(dataTable); or cell.InsertData(dataTable); or cell.InsertTable(dataTable);
See the "Inserting Data/Tables" section of the Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With