DATATABLE Split into Chunks

Hi I have a datatable with lakhs of rows into it . now i want to Spit the datatable into chunks of 30000 and add it to the excel file … How can i acheive this

Hi @vishal_nachankar

Please look into the following thread:

Best Regards.


Please check this



Hope the following sample helps you.

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 (8.6 KB)


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.