当前位置: 代码迷 >> ASP.NET >> linq降序OrderByDescing,不成功解决方法
  详细解决方案

linq降序OrderByDescing,不成功解决方法

热度:6588   发布时间:2013-02-25 00:00:00.0
linq降序OrderByDescing,不成功
默认排序是这么写的
EnumerableRowCollection<DataRow> sortquery = from order in datatable.AsEnumerable()
  orderby order.Field<string>(e.SortExpression)
  select order;
降序,好多人说是OrderByDescing,我把orderby 替换成OrderByDescing出错了

------解决方案--------------------------------------------------------
http://www.cnblogs.com/lyj/archive/2008/01/24/1051495
------解决方案--------------------------------------------------------
EnumerableRowCollection<DataRow> sortquery = from order in datatable.AsEnumerable()
orderby order.Field<string>(e.SortExpression) descending
select order;
------解决方案--------------------------------------------------------
from order in datatable.AsEnumerable()
orderby order.Field<string>(e.SortExpression) descending
select order;
  相关解决方案