DataTable DataRow [] Sorting columns

dt = dt.AsEnumerable().OrderByDescending(x=>x.Field<decimal>("C_ID")).ThenByDescending(x=>x.Field<decimal>("C_NAME"))
    .Select(x=>x)
    .CopyToDataTable();
dt = dt.Select("1=1").OrderByDescending(x=>x["C_ID"]).ThenByDescending(x=>x.["C_NAME"])
    .CopyToDataTable();

C_ID flashback press and then turn into a positive sequence C_NAME Datatable

Guess you like

Origin www.cnblogs.com/net-god/p/12144694.html