日期:2014-05-18  浏览次数:20405 次

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.html