c# - the fastest way to read the data from DataTable? -
how can read info in datatable fastest way?
character character
recording recording
records * record size, can not
i'm trying find size of datatable
my question linked here
division of book file
what else?
you have loop table anyway, can utilize linq-to-datatable
short , readable code. assuming have strings only:
var columns = table.columns.cast<datacolumn>().tolist(); int totalcharactercount = table.asenumerable() .sum(r => columns.sum(c => r.field<string>(c).length));
the inner columns.sum
calculates , sums length of strings in each column of 1 datarow
, outer sum
calculates total-sum, adds row's sum together.
c# xml datatable
No comments:
Post a Comment