var records = dataSet.Tables[0].Rows.Cast<System.Data.DataRow>().Take(10);
Above line will fetch 10 records from existing dataset. If you want to fetch 4 or 5 records, you only have to change the value inside Take function.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.
priti shrivastavaPosted Sep 7, 2020, 10:00 AM
How can i get only 10 records in dataset
Satya SrinivasPosted Aug 21, 2012, 7:26 AM
Informative!