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 }
Source: stackoverflow.com
Related Query
- The type of one of the expressions in the join clause is incorrect when the types are the same
- The type of one of the expressions in the join clause is incorrect in Entity Framework
- Type of one of the expressions in the join clause is incorrect
- LINQ - 'The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'GroupJoin'.'
- C# Linq to Entities: The type of one of the expressions in the join clause is incorrect. Type inference failed
- The type of one of the expressions int he join clause is incorrect. Type inference failed in the call to 'join'
- C# Linq to SQL: The type of one of the expressions in the join clause is incorrect. Type inference failed
- The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'
- the same old "the type of one of the expressions in the join clause is incorrect"
- The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'GroupJoin'
- Compilation error in one case but not the other, when all expressions have same types
- The Type of one of the Expression in the join clause is incorrect.Type inference failed in the call to join
- Query expressions over source type 'dynamic' or with a join sequence of type 'dynamic' are not allowed
- LINQ: Include clause is causing two left join when there should be one
- Using Linq in an Anon Type using one of the Anon Types Properties
- Left Join on Linq query when also using the Where clause on joint table
- c# can I type the code I want to execute in LINQ expressions
- How to LINQ Join when one key is an ArrayOfInt and the other an int
- How to join in two tables when one table doesn't have a definition for the other
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Left join on two Lists and maintain one property from the right with Linq
- How do you left join in Linq if there is more than one field in the join?
- When to prefer joins expressed with SelectMany() over joins expressed with the join keyword in Linq
- When using a LINQ Where clause on a Dictionary, how can I return a dictionary of the same type?
- linq query to join two tables and get the count from one table values from the other
- Left outer join using LINQ -- understanding the code
- C# LINQ Select objects with the same value of one property join values of other
- When to use lambda expressions instead of a Where clause in LINQ
- The data reader has more than one field. Multiple fields are not valid for EDM primitive types
- Type inference failed in the call to 'Join' when using anonymous type
More Query from same tag
- Filter list matching all ids
- Linq to Object -Object update
- How to group and subgroup and get data from a linq query
- C# : Parse XML using XDocument into a csv file
- Convert Double to Decimal in LinQ Query
- LINQ not executed correctly
- Locate the record closest top 5000 meters before
- Convert System.Linq.IOrderedEnumerable<T> to List<T>
- How to create an extern alias for System.Core?
- What am I missing in this simple MVC application with the querying report table?
- LINQ Methods are Extension Methods?
- Creating table which changes a column in order to remove repeated values in rows
- Output to console group with the best GPA (using LINQ, without loops)
- Creating a list, getting an element from each nested list
- Entity Framework Select Statement with Logic
- How to fill DataGridView in a MVP project?
- linq how to process each element?
- LINQ merge two grouped query results
- Calculate Average Age from a list of dates using linq
- Linq join on parameterized distinct key
- Consolidate many if conditions to a single LINQ statement using OR
- How to tell if an IEnumerable<T> is subject to deferred execution?
- C# - boolean property value wont change :(
- Update two fields with linq and DataSet
- "ADD" to DataGridView from XML file
- Linq With TakeWhile in C#
- LINQ - Find all records where all items in a given list are contained in an icollection
- Can not read XML when same element exists twice
- How to Sort NameValue Collection and Store it in a string
- Linq to CSV DateTime format using C#