Copy a number of rows from Datatable to clipboard

Hello, what is the best approach for getting a number of rows from datable to clipboard. Currently using a for each row activity but apparently it would take time if its 3000 row. Is there a better approach than this?

For example.
I have 100 rows in a datatable and I want to copy the first 10 rows and paste it on a search engine. Ex(1,2,3,4,5,6,7,8,9,10) then after (11,12,13,14,15,16,17,18,19,20).

Hi @acdeleon123

To get the number of rows u can try dt1.Rows.Count

I mean I want to copy first 10 rows in datatable and paste it notepad then the other 10 rows until it reach the 100 rows

So u need to copy all rows to the notepad ?

Is it right ?

you want overwritten values or all values.
for e.g suppose for 1st run it writes 1-5 then in second it will overwrite the 1-5 and then it will put 6-10
Just let me know you wanted like this

Yes please. This is what I’m looking for

Convert datatable to List. Then use method List.GetRange(Index,ChunkSize)
The list will return the rows from the index onwards of ChunkSize.




please follow the steps
cannot share the xaml because i am new user
let me know if you need any help

Why would you use copy/paste for this? Just use Type Into.