private DataTable SortTable(DataTable dt,string[] pids) { DataTable dt0 = dt.Clone(); //复制原表结构 for(int i=0;i<pids.Length;i++) { if(pids[i] != string.Empty) { DataRow[] drs = dt.Select("pos_id=" + pids[i]); if(drs.Length > 0) { foreach(DataRow dr in drs) { dt0.ImportRow(dr); //导入行 } } } } return dt0; }