1
private DataSet RebuildDataSet(DataSet dataSet)
2
{
3
DataSet dsTemp = dataSet;
4![]()
5
if (dsTemp.Tables["Summary"].Rows.Count > 0)
6
{
7
for (int i = 0; i < dsTemp.Tables["Summary"].Rows.Count; i++)
8
{
9
string titleName = GetTitleName(dsTemp.Tables["Summary"].Rows[i]["QtHeaderId"]);
10![]()
11
dsTemp.Tables["Summary"].Rows[i].BeginEdit(); //开始修改
12
dsTemp.Tables["Summary"].Rows[i]["TitleName"] = titleName; //修改
13
dsTemp.Tables["Summary"].Rows[i].EndEdit(); //结束修改
14
dsTemp.Tables["Summary"].Rows[i].AcceptChanges(); //提交
15
}
16
dsTemp.Tables["Summary"].DefaultView.Sort = this.OrderBy + " DESC";
17
dsTemp.Tables["Summary"].AcceptChanges();
18
}
19![]()
20
return dsTemp;
21
}
private DataSet RebuildDataSet(DataSet dataSet)2
{3
DataSet dsTemp = dataSet;4

5
if (dsTemp.Tables["Summary"].Rows.Count > 0)6
{7
for (int i = 0; i < dsTemp.Tables["Summary"].Rows.Count; i++)8
{9
string titleName = GetTitleName(dsTemp.Tables["Summary"].Rows[i]["QtHeaderId"]);10

11
dsTemp.Tables["Summary"].Rows[i].BeginEdit(); //开始修改12
dsTemp.Tables["Summary"].Rows[i]["TitleName"] = titleName; //修改13
dsTemp.Tables["Summary"].Rows[i].EndEdit(); //结束修改14
dsTemp.Tables["Summary"].Rows[i].AcceptChanges(); //提交15
}16
dsTemp.Tables["Summary"].DefaultView.Sort = this.OrderBy + " DESC";17
dsTemp.Tables["Summary"].AcceptChanges();18
}19

20
return dsTemp;21
} //对DataView 进行条件查询和排序
DataView oView = new DataView();
oView.RowFilter = Where; // sql条件
oView.Sort = OrberBy; // 排序

浙公网安备 33010602011771号