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 6705673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:25:52+00:00 2026-05-26T07:25:52+00:00

I am just wondering about how we can determine whether to use join or

  • 0

I am just wondering about how we can determine whether to use join or not in linq to sql.

Eg. let say if we have two tables like this

Table 1   Customer
          id
          name

Table 2   addresstype
          id
          address1
          customerid

and

var address = from cu in Customer
              from ad in addresstype
              where cu.id == ad.customerid
              select ad;

or

var address = from cu in Customer
              join ad in addresstype on cu.id equals ad.customerid
              select de;

Is both way are the same. Is there any difference in performance?

Also the second method, will it come up with an error if there isn’t any matching?

  • 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-05-26T07:25:53+00:00Added an answer on May 26, 2026 at 7:25 am

    Basically, these two LINQ queries are equivalent to the following SQL queries:

     select ad.*
     from Customer cu, AddressType ad
     where cu.ID == ad.CustomerID -- I assume this was meant by the OP
    

    and

    select ad.*
    from Customer cu
      inner join AddressType ad on cu.id = ad.CustomerID;
    

    The difference between these two queries is mostly semantic, since the database will do the same thing in both cases and return a same result set for both queries.

    I would prefer the join syntax in both SQL and LINQ since it defines an explicit relationship between the two tables/entities, that is only implied in the join-less version.

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

Sidebar

Related Questions

Just wondering about some practice about this; I have made a simple visual C#
I'm just wondering about large projects - say an airlines reservation system, how many
I was just wondering about something. I have a frame that loads pages and
Just wondering about how to avoid Magic Strings in Querystrings? I have a lot
I'm just wondering about an implementation detail of Scala generics. In C# one can
I was just wondering about why should I use property in a class instead
I'm just wondering about data validation in Spring. Spring is offering two (maybe more)
Just wondering if there is a standard/default overlay/marker that I can use in the
Just wondering about the performance impact of copying very large php variables. For example
Just wondering about this code below... when I turn off my internet connection and

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.