开发者

ClosedXML. Adding DataTable to existing Excel worksheet

How using ClosedXML library in fastest way (from performance point of view) add values from DataTable to already existing Excel w开发者_高级运维orksheet?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜