0
public static DataTable resort(DataTable dt)       
{

    string sortByColumnsStr = "Time Elapsed  DESC";
    DataView dtview = new DataView(dt);
    dtview.Sort = sortByColumnsStr;
    DataTable dtsorted = dtview.ToTable();        
    return dtsorted;
}
4

1 回答 1

0

用方括号嵌入列名,如下所示:

string sortByColumnsStr = "[Time Elapsed] DESC";

你最终可以看看这个:http ://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/1f37f760-b479-4b4a-a2db-0e828812ac0e/

于 2013-02-28T07:37:02.043 回答