加入的问题

时间:2010-03-22 09:30:13

标签: c# linq join

我有这段代码:

int se = (int) settings.GruppoSegreteria;
    var acc = db.USR_Accounts.Where( p => p.ID_Gruppo == se);
    var segreterie = from s in db.USR_Utenti 
                     join h in acc on s.ID equals h.USR_UtentiReference
                     select s;

这个错误:

The type of one of the expressions in the join clause is incorrect.  Type inference failed in the call to 'Join'

我不明白。 你能救我吗?

感谢

1 个答案:

答案 0 :(得分:2)

您正加入s.IDh.USR_UtentiReference。我猜他们不是同一类型?你必须加入两个整数(例如)。你不能加入int和其他类型。

相关问题