Click here to Skip to main content
12,825,359 members (36,694 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL LINQ
Hi All,

I want to convert below sql to linq, Multiple on clause in join statements
select * from dbo.Table1              	 
LEFT OUTER JOIN dbo.Table2 AS Table2                     	 
INNER JOIN dbo.Table3 AS Table3 ON Table3.Id = Table2.LnId 
 ON Table2.Id = Table1.Column1 

This is my linq Statement
from Table1 in ctxk.Table1
join Table2 in ctx.Table2 on  equals  into ExternalPerson_join
from Table2 in ExternalPerson_join.DefaultIfEmpty()
join Table3 in ctxk.Table3 
on  new 
aid = Table2.LnId, 
bid = Table2.Id  
 aid = Table3.Id, 
 bid = Table1.LnId   
select new {

linq statement raises error
"Invalid expression term 'equals'
Expected contextual keyword 'equals'"

How to fix it

Thank you
Posted 3-Jan-13 2:22am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


See the following links for your solution.

multiple tables join by Linq
linq join 3 tables with or condition

This will help you to find out your solution.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100