DataTable 排序

DataRow[] rows = dataTable1.Select("", "ord asc");

DataTable t = DataTable1.Clone();

t.Clear();

foreach (DataRow row in rows)

    t.ImportRow(row);

DataTable1 = t;

VS2005中这种方法最简单:
DataView dv = dt.DefaultView;
dv.Sort = "c1 Asc";
DataTable dt2 = dv.ToTable();

posted on 2007-05-29 21:48  大豆男生  阅读(8135)  评论(6编辑  收藏  举报

导航