Hi
@Swati AgrawalYou can use some Linq code to achive this.
I attach you to this post the complete object to achieve this.
You need to give to the Action "Select Top" the Collection and the top number that you want to return. As an output, you will get the same collection.
The code looks like this:
dtResult = dt.AsEnumerable().Take((int)ntop).CopyToDataTable();Where dt is the Collection, and ntop is the number of rows that you want to get.
Hope this helps you. And if this solves the problem, remember mark as the best answer.
See you in the community, bye
🙂
------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
------------------------------