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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:11:33+00:00 2026-05-11T09:11:33+00:00

In the L2S designer I have dropped a table and a view. I tried

  • 0

In the L2S designer I have dropped a table and a view. I tried adding an association between the 2 on their primary keys. This should be a one-to-one relationship, so I set the cardinality property of the association as such.

But, when coding I can’t access the child property.

Any suggestions?

Edit

I just created a view in sql server that has the fields I want, and dropped that into L2S. Much simpler.

  • 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. 2026-05-11T09:11:33+00:00Added an answer on May 11, 2026 at 9:11 am

    In my experience Linq To SQL requires the Primary/Foreign key relationships established in the DB. Otherwise, you’ll have to do a join.

    Not sure if this applies to your situation, but it may…

    Linq To SQL Without Explicit Foreign Key Relationships

    UPDATE:

    It appears that you can get what you’re looking for without establishing the Primary/Foreign key relationships in the database. In the LinqToSQL designer set primary keys on both columns on each table. I also had to turn off Auto-Sync on Parent Table’s column that I assigned as a primary key.

    Auto-Sync is described here.. Instructs the common language runtime (CLR) to retrieve the value after an insert or update operation.

    Link: http://msdn.microsoft.com/en-us/library/bb386971.aspx

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

Sidebar

Related Questions

I have a L2S query with several joins that should returns 11 records in
I have a question similar to this but in the context of L2S. I
We're using L2S and we have a class like this: public class HumanContainer {
Lets say I have two L2S classes generated by the designer with one property
I have a L2S query that looks like this: using (MyDC TheDC = new
I'm trying to convert this SQL query to L2S.. SELECT TOP 5 vt.* FROM
I have a question regarding a problem with L2S, Autogenerated DataContext and the use
I have a small L2S database that was generated with the L2S CreateDatabase command.
What pattern should I use for data-access in case of VS2008 generated L2s or
Is it possible to create a new table programatically in EF or L2S 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.