score:18

Accepted answer

the types of memberid and locationid may be the same, but they have to have the same name as well.

in your example, one of them has id (capital d) and the other has id (lower-case d). that is enough to make the anonymous types separate types.

you can fix this by specifying names explicitly, for example:

 join l in location.tbllocations
 on new { k.memberid, k.locationid } equals
 new { memberid = l.memberid, locationid = l.locationid }

Related Query