问题描述:

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;

}

网友答案:

Embed the column name with square brackets, like this:

string sortByColumnsStr = "[Time Elapsed] DESC";

You can eventually take a look at this: http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/1f37f760-b479-4b4a-a2db-0e828812ac0e/

相关阅读:
Top