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

  • Home
  • SEARCH
  • 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 1096993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:21:51+00:00 2026-05-17T00:21:51+00:00

I am using LinqToSql on a project, and Ria services to expose it as

  • 0

I am using LinqToSql on a project, and Ria services to expose it as an IQueryable.
I want to send my Product table along with its child tables (e.g. ProductStatus, ProductCategory)

To do this I am using the standard

public IQueryable ProductSelect() {

DataLoadOptions loadOpts = new DataLoadOptions();
loadOpts.LoadWith<Product>(p => p.ProductStatus);
loadOpts.LoadWith<Product>(p => p.ProductCategory);
this.DataContext.LoadOptions = loadOpts;

return this.DataContext.Products; }

Unfortunately this is creating inner joins, not left joins. There isn’t referential integrity on the tables (I can’t add it in).

This means if the there isn’t a matching record in the child table, then the product will not be selected.
Does anyone know how to change this to be a left join?

  • 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-17T00:21:52+00:00Added an answer on May 17, 2026 at 12:21 am

    Found the answer. In the DBML file where I have the tables and the associations. It is related to the foreign key Ids.

    If the foreign key is not nullable, then it does an inner join.
    if you make the field nullable, then it will do a left join.

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

Sidebar

Related Questions

I have a project with a formidable data access layer using LinqtoSQL for just
I'm engaged in writing a product using LinqToSql for data-access. While we're rapidly developing,
Using Silverlight 3 and RIA Services I have the following class defined in my
I'm using LinqToSQL in a 3.5 framework project in VS2K8, running against MS SQL
I've been working on a project where I have been using LinqToSQL that involved
I'm using MVC 2 with some Models from a LinqToSql project that I built.
I'm using Linq2Sql for my asp.net mvc project and so far it has worked
I just started creating my data-access layer using LinqToSql. Everybody is talking about the
I'm writing an .NET 3.5 web application that is using LinqToSql for the basic
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL

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.