Blog
Get top 10 records from dataset
In this blog, i let you know, how to get top 10 records from dataset.
We can easily pic few records from dataset by using this code snippet.
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.