Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:59:34+00:00 2026-06-05T09:59:34+00:00

I know the Linq’s left join is similar like this: var q=from e in

  • 0

I know the Linq’s left join is similar like this:

var q=from e in db.Employes    
      join o in db.Orders on e equals o.Emoloyee into ords  
      from on in ords.DefautIfEmpty()
      select new
      {      
         e.FirstName,     
         e.LastName   
      };

then how about the multiple join? here is my code

var personalInfoQuery = from t in crnnsupContext.Tombstones
                        join p in crnnsupContext.ProvStates on t.ProvinceState equals p.ProvinceStateID 
                        join n in crnnsupContext.NursingSchools on t.NursingSchool equals n.SchoolID 
                        join i in crnnsupContext.InitialEducations on t.InitialEducation equals SqlFunctions.StringConvert((double)i.InitalEducationID, 1)
                        join g in crnnsupContext.tbl_GraduatedProvCountry on t.GradPovCountry equals g.id
                        where t.RegNumber == _username
                        select new CPersonalInfo
                        {
                            ProvState = p,
                            Tombstone = t,
                            NursingSchool = n,
                            InitialEducation = i,
                            GraduatedProvCountry = g,
                         };

each joined table could have “null” field. can any help me, thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:59:36+00:00Added an answer on June 5, 2026 at 9:59 am

    Multi join should look quite similar – it gets quite verbose, but I would give this a try.
    You might need some null checking in the final where line too.

    var personalInfoQuery = from t in crnnsupContext.Tombstones
                            join p in crnnsupContext.ProvStates on t.ProvinceState equals p.ProvinceStateID into group1
                            from g1 ini group1.DefaultIfEmpty()
                            join n in crnnsupContext.NursingSchools on g1.NursingSchool equals n.SchoolID into group2
                            from g2 in group2.DefaultIfEmpty()
                            join i in crnnsupContext.InitialEducations on g2.InitialEducation equals SqlFunctions.StringConvert((double)i.InitalEducationID, 1) into group3
                            from g3 in group3.DefaultIfEmpty()
                            join g in crnnsupContext.tbl_GraduatedProvCountry on g3.GradPovCountry equals g.id into group4
                            from g4 in group4.DefaultIfEmpty()
                            where g4 == null || g4.RegNumber == _username
                            select new CPersonalInfo
                            {
                                ProvState = p,
                                Tombstone = t,
                                NursingSchool = n,
                                InitialEducation = i,
                                GraduatedProvCountry = g,
                             };
    

    There seems to be another way of doing outer joins as well but without having something to test it on I’m not even sure if it’s possible to use it in this case – check out the answer on this post if you’re interested:
    outer join in linq

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this is Linq: var _Results = from item in _List where
I know almost nothing about linq. I'm doing this: var apps = from app
I want to be able to take a LINQ statement like this. var User
Customer wants to move from SQL server to Sybase database. Don't know if LINQ
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can
I've this linq query and don't know why it is not working. itemDetails is
I know LINQ has a SequenceEquals method. This method makes sure each item value
Does anyone know what Join algorith does LINQ performs with its Join operator. Is
I know Linq-to-SQL is dead, but anyway, I think this is really basic, I'm
I know in normal Linq grammar, orderby xxx descending is very easy, but how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.