datalist数据排序
void pai(out DataSet dt, DataSet dd, out bool chk, bool ch)
{
chk = ch;
dt = dd;
DataTable dt1 = dd.Tables[0].Clone();
for (int j = 0; j < dd.Tables[0].Rows.Count; j++)
{
DataRow dr=dt1.NewRow();//复制表dt1的行结构
for (int i = 0; i < dd.Tables[0].Columns.Count; i++)
{
if (chk)
{
dr[i] = dd.Tables[0].Rows[dd.Tables[0].Rows.Count - 1 - j][i];
if (j== dd.Tables[0].Rows.Count - 1&&i==dd.Tables[0].Columns.Count-1)
{
chk = false;
}
}
else
{
dr[i] = dd.Tables[0].Rows[j][i];
if (j == dd.Tables[0].Rows.Count - 1 && i == dd.Tables[0].Columns.Count - 1)
{
chk =true;
}
}
}
dt1.Rows.Add(dr);
}
dt.Tables.Clear(); //清除表
dt.Tables.Add(dt1);
}