我这里使用了DataList 和 AspNetPaper 做分页。
因为我的数据是在前台分页的,这里数据库排序的方法不讨论。
我想知道的是如何对DataTable进行排序。因为这里如果采用DataTable.DefaultView.Sort只能对DataView进行排序,那样的话,我只能在单页进行排序,这样做的意义不大,所以求能对DataTable的排序方法!

解决方案 »

  1.   

    DataView myDataView = DataTable1.DefaultView;
       // By default, the first column sorted ascending.
       myDataView.Sort = "State, ZipCode DESC";
    datalist.datasource =    myDataView;
      

  2.   

    楼上的没有明白我的意 思,这样我也知道是可以的。因为我是在客户端分页的,实际绑定的并不是全部数据。DataView 怎么分页呢?