Get top N rows from a datatable

datatable

#1

Hi All,
I have a datatable which has around 500 records at any point of time.
The business requirement is to process only 200 records from that datatable at any point of time.

I found the following query to get top N rows out of a datatable but Cast doesnt seem to work in UiPath.
dt2 = dt.Rows.Cast<System.Data.Datarow>.Take(n).CopyToDatatable.

Any other way these could be done?

Thanks


#2

@ankwoods, Refer this, An Existing Solution

Regards,
Dom :slight_smile:


Create a data table that does not contain all data
#3

Thanks Dominic. Somehow this article skipped my feed.