c# - Hi, I have a dataset containing N number of records and i am trying to read each 100 records from dataset until it finish count -
i have dataset containing n number of records , trying read each 100 records dataset loop through , save them until reaches total count n in c#. couldn't through , looking or advice on how dot his..
assuming have untyped dataset:
dataset ds = new dataset(); //filling dataset var rows = ds.tables["mytable"].rows.oftype<datarow>().tolist(); var size = rows.count; var position = 0; var chunksize = 100; while (position < size) { var chunk = rows.skip(position).take(chunksize); position += chunksize; }
Comments
Post a Comment