how to get 10 records from table in c#

Introduction:
  Get 10 records from table

Codings in C#:

  var records=dt.Rows.Cast<System.Data.DataRow>().Take(10);
datatable dtt=new datatable();
dtt=(DataTable)records.CopytoDataTable<DataRow>();

Comments