Created
April 21, 2014 01:31
-
-
Save FrankFan/11129824 to your computer and use it in GitHub Desktop.
DataTable 排序
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// DataTable 排序 | |
/// </summary> | |
/// <param name="dt"></param> | |
/// <param name="orderBy"></param> | |
/// <returns></returns> | |
protected DataTable SortDataTable(DataTable dt, string keyword, string orderBy) | |
{ | |
LogHelper.LogInfo("调用 SortDataTable() 方法"); | |
DataView dv = dt.DefaultView; | |
dv.Sort = keyword + " " + orderBy; | |
dt = dv.ToTable(); | |
return dt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment