Luca Romagnoli
Luca Romagnoli

Reputation: 12475

problem with a join

I have this code:

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;

And this error:

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

I don't understand it. Can you help me?

thanks

Upvotes: 3

Views: 92

Answers (1)

Mattias Jakobsson
Mattias Jakobsson

Reputation: 8237

You are joining on s.ID and h.USR_UtentiReference. I guess they are not of the same type? You have to join on two ints (for example). You can't join on a int and some other type.

Upvotes: 2

Related Questions