DataRow 提供了排序的方法 不知道有没有用 sdk上的例子private void GetRowsByFilter(){ DataTable myTable; myTable = DataSet1.Tables["Orders"]; // Presuming the DataTable has a column named Date. string strExpr; strExpr = "Date > '1/1/00'"; DataRow[] foundRows; // Use the Select method to find all rows matching the filter. foundRows = myTable.Select(strExpr); // Print column 0 of each returned row. for(int i = 0; i < foundRows.Length; i ++){ Console.WriteLine(foundRows[i][0]); } }
sdk上的例子private void GetRowsByFilter(){
DataTable myTable;
myTable = DataSet1.Tables["Orders"];
// Presuming the DataTable has a column named Date.
string strExpr;
strExpr = "Date > '1/1/00'";
DataRow[] foundRows;
// Use the Select method to find all rows matching the filter.
foundRows = myTable.Select(strExpr);
// Print column 0 of each returned row.
for(int i = 0; i < foundRows.Length; i ++){
Console.WriteLine(foundRows[i][0]);
}
}
楼主直接操作dataSet1.Tables["table1"].DefaultView.Sort的属性就是了。
这个问题我在ms的动力营也问过了,看来是不可能了,结了吧