Use skip() and Take() method in linq

HI,

How about the following?

Enumerable.Range(0,(dt.Rows.Count \ chunkSize)+1).Select(Function(i) dt.AsEnumerable.Skip(i*chunkSize).Take(ChunkSize).CopyToDataTable).ToArray

Sample20221108-4.zip (132.8 KB)

Regards,

2 Likes