Click here to Skip to main content
15,036,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
select * 
from lst1 left join lst2 on lst1.ID=lst2.ID

i want linq statement equivalent to this?
Updated 18-Sep-12 18:50pm
Mehdi Gholam 19-Sep-12 0:41am
And the question is?
faezeh66 19-Sep-12 0:48am
this is a sql statement i want linq statement of this?

1 solution

You should have tried! Please do share your effort made from next time.

It would be something like:
from lst1 in TXs
       join lst2 in TYs on lst1.ID equals lst2.ID into yG
       from y1 in yG.DefaultIfEmpty()
       select new { X = lst1, Y =y1 }

Learn from here:
MSDN: How to: Perform Left Outer Joins (C# Programming Guide)[^]
Converting SQL to LINQ, Part 1: The Basics (Bill Horst)[^]

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900