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.

@vishal_nachankar

Please check this

Cheers

Hi,

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

Sample20230427-5L.zip (8.6 KB)

Regards,

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