I want to split DataTable so that I can upload its chunks from one place to other.
For example
pick first 100 rows.
pick next 100 rows.
pick next 100 rows and so on ...
Is there any way to do it just like cursor in Database? I do not like to use loops etc. for counting rows.
YourDataTable.Select()
gives you an array of Data
What about linq?
Fro example YourDataTable.Select (x => x).Take (100).ToEnumerable()
gives you the first 100 DataRows
and YourDataTable.Select (x => x).Skip(100).Take (100).ToEnumerable()
for the next 100.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With