Http://hi.baidu.com/jiang_yy_jiang/blog/item/27ab17c436e2a6c638db496f.html
Datatable dt = getdetails (). Tables [0]; // obtain available datatable
// Var M = DT. asenumerable (). Last <datarow> (); returns the last datarow row of the datatable.
// Var M = DT. asenumerable (). First <datarow> (); returns datarow of the first row of the able.
// Var M = DT. asenumerable (). Count <datarow> (); returns the total number of datatable rows.
// Var M = DT. asenumerable (). elementat <datarow> (tipindex); returns the datarow of the tipindex entry of the able.
// Var M = DT. asenumerable (). Reverse <datarow> (); sorts datatable in reverse order.
// Var M = DT. asenumerable (). Skip <datarow> (tipindex); tipindex entries before the datatable are skipped
VaR M = DT. asenumerable (). Take <datarow> (tipindex); // extract the tipindex entries before the datatable.
Datatable T = M. copytodatatable <datarow> ();
The last uncommented is frequently used and can be used to extract the first n rows, similar to Top N in SQL.