2010-03-22 63 views
3

我有這樣的代碼:問題與加入

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' 

我不明白。 你能幫我嗎?

感謝

回答

2

你是加盟的s.IDh.USR_UtentiReference。我猜他們不是同一類型的?您必須加入兩個整數(例如)。你不能加入一個int和其他類型。