DataTable 排序

方式一:

DataRow[] rows = dtStart.Select("", "Createdate asc");
DataTable dttwo = dtStart.Clone();
    dttwo.Rows.Add(row);
     dtStart= dttwo ;

方式二:

DataView dv = dt.DefaultView;
dv.Sort = "ID Asc";
dt = dv.ToTable();

还是第二种比较简单,适合经常用;

转载于:https://www.cnblogs.com/springyangwc/archive/2011/03/04/1971027.html

你可能感兴趣的:(DataTable 排序)