Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Here is the database query ...

SQL
SELECT Circular_Id,Circular_Name,Topic,StartDate,EndDate,detail1,detail2,detail3,Name,branch_name FROM Circular C INNER JOIN Circular_Type CT ON C.Circular_Type_Id = CT.Circular_Type_Id INNER JOIN SMS_Branches B ON B.branch_id = C.branch_id


What I have tried:

how to create linq query from the database query written above... please help!
Posted
Updated 21-May-18 23:38pm

Check this:
join clause (C# Reference) | Microsoft Docs[^]
Perform inner joins | Microsoft Docs[^]
Perform left outer joins | Microsoft Docs[^]
Perform grouped joins | Microsoft Docs[^]

C#
var result = from a in tablea
      join b in tableb on a.PrimaryKey equals b.ForeignKey
      join c in tablec on b.PrimaryKey equals c.ForeignKey
      select new {...};
 
Share this answer
 
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
Comments
SHAHBAZ-1706 19-May-18 5:54am    
Thanks, I have solved the problem myself. It was just a matter of trouble that I solved
OriginalGriff 19-May-18 5:58am    
Excellent!

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