I have a master datatable which will have roughly 150-200 rows.
Now I have to split this datatable into batches of 30 and this has to be dynamic because I will not know how many rows my master datatable can have, so i can’t put static values.
As for now, I have split 2 batches of 30 each as below:
batch1DtTble = dtTble.AsEnumerable().Take(30).CopyToDataTable()
batch2DtTble = DtTble.AsEnumerable().Skip(30).Take(30).CopyToDataTable()
I can still continue with the same approach and get all the batches but I’m looking for some dynamic approach to split batches in run time or something more flexible approach working with total rows in my master datatable to be split.
Any suggestions, please ?