How to take the first set(ConfigValue) of records in a loop

Hi,

FYI, another approach:

chunksize = 2000

then

arrDt = Enumerable.Range(0,(dt.Rows.Count \ chunksize) -CInt(dt.Rows.Count mod chunksize <>0)).Select(Function(i) dt.AsEnumerable.Skip(i*chunksize).Take(chunkSize).CopyToDataTable).ToArray

returns datatable array which has chunksize (2000) rows (the last item has remaining rows)

Then iterate this array.

Regards,

4 Likes