当前位置: 代码迷 >> ASP.NET >> Linq 查询 join 失败 !该如何解决
  详细解决方案

Linq 查询 join 失败 !该如何解决

热度:10894   发布时间:2013-02-25 00:00:00.0
Linq 查询 join 失败 !!
string[] NewsUsers = System.Web.Security.Roles.GetUsersInRole("NewUsers");
   
  var newOrderUserList = from aspuser in nsdb.aspnet_Users
  join u in NewsUsers
  on aspuser.UserName equals u


 提示join 子句中的一个表达式类型不正确,对join调用中的类型推理失败

------解决方案--------------------------------------------------------
var newOrderUserList = (from aspuser in nsdb.aspnet_Users 
where NewsUsers .contains(aspuser.UserName )
select aspuser ).tolist()

------解决方案--------------------------------------------------------
http://www.cnblogs.com/lyj/archive/2009/02/16/1051495
  相关解决方案