阿宽

Nothing is more powerful than habit!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

DataEntity中在当前范围或上下文中无法解析解决方法

Posted on 2011-04-10 10:18  宽田  阅读(808)  评论(0)    收藏  举报

我在DataEntity中执行下列语句时老是报“在当前范围或上下文中无法解析……”错误。

select Max(ReturnDate) as RtnDate,Max(ReturnManner) as RtnManner,
Max(ReturnContent) as RtnContent,Max(ResultWill) as RtnResultWill,
ConDetailid
from YXSchoolV2DBEntities.T_Return as t
where t.flag = true 
group by t.ConDetailid

 

将上边语句中列名加上别名解决。

select Max(t.ReturnDate) as RtnDate,Max(t.ReturnManner) as RtnManner,
Max(t.ReturnContent) as RtnContent,Max(t.ResultWill) as RtnResultWill,
t.ConDetailid
from YXSchoolV2DBEntities.T_Return as t
where t.flag = true 
group by t.ConDetailid