日期:2014-05-17 浏览次数:20752 次
//先上我的代码吧(这个可以排序):
//按奖金的升序排序.
void OrderDataByPriceAscending(object sender, EventArgs e) {
var sorted = from employee in set.Tables["T_Employee"].AsEnumerable()
orderby employee.Field<int>("FAge") ascending
select employee;
dataGV.DataSource = sorted.AsDataView();
}
//(这个不可以排序)
//按奖金的升序排序.
void OrderDataByPriceAscending(object sender, EventArgs e) {
var sorted = from employee in set.Tables["T_Employee"].AsEnumerable()
orderby employee.Field<float>("FPrice") ascending
select employee;
dataGV.DataSource = sorted.AsDataView();
}