How to select top n rows from a datatable/dataview in ASP.NET

前端 未结 7 1832
轻奢々
轻奢々 2020-12-13 02:09

How to the select top n rows from a datatable/dataview in ASP.NET? Currently I am using the following code, passing the table and number of rows to get the records. Is there

相关标签:
7条回答
  • 2020-12-13 02:52

    In framework 3.5, dt.Rows.Cast<System.Data.DataRow>().Take(n)

    Otherwise the way you mentioned

    0 讨论(0)
提交回复
热议问题