注册 登录
编程论坛 F#论坛

linq union后怎么按时间排序

冷血DE虎儿 发布于 2011-12-08 17:28, 5708 次点击
程序代码:
var query1 =
                (from pl in sds.Tables[0].AsEnumerable()
                 where "12" == pl.Field<string>("SysType")
                 select pl).Union
                  (from pl in sds.Tables[0].AsEnumerable()
                   where "22" == pl.Field<string>("SysType")
                   select pl).Union
                   (from pl in sds.Tables[0].AsEnumerable()
                    where "32" == pl.Field<string>("SysType")
                    select pl);
怎么将这个结果集按时间降序排序   其中我数据库里的时间属性名为  UplodDate
    希望高手帮忙解决下  谢谢···
1 回复
#2
qq6454851652013-05-22 19:59
你查出的数据可以作为一个视图或表,再进行查询
from p in
let pp=/* -----*/这段代码是你的截图代码,一省略
orderby pp.UplodDate
select p
你看看行不?我没试过,

1