Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
select A.ID,B.TestName  from sampleTable A join TestTable b on A.ID<>B.ID

How to write this using LINQ?
Can any one help please?
Posted
Updated 14-Jan-14 7:29am
v2

Follow these 2 links which will teach you to do that:
how to join two tables using linq query[^]
C# Join with LINQ[^]
 
Share this answer
 
Try this..


C#
sampleTable.Join(TestTable,(k=>k.ID),(k=>k.ID),(s,t)=> new { ID= s.ID, TestName= t.TestName}).ToList();
 
Share this answer
 
Use tools like LINQPad[^], it'll save your massive time.
 
Share this answer
 

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