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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:43:04+00:00 2026-05-15T10:43:04+00:00

I am very new to the ADO Entity Framework, and I’m looking for the

  • 0

I am very new to the ADO Entity Framework, and I’m looking for the best practice.

Here is the scenario: I have a database with a Person table and an Address table. Person has a foreign key referencing the primary key of Address, an auto-incrementing int. First, I’ve created an ADO Entity model with VS 2010, and sure enough the relationship is understood by the IDE.

Now I want to create a Windows Form that allows the user to fill in a Person‘s basic info and Address. Normally, I can just drag the Person entity onto a blank Windows Form, and VS2010 will automatically create the necessary fields along with the binding. But what extra work do I need to do in order to ensure the following happens when this form is filled out by the user:

  1. The Address portion of the form is saved in the Address table
  2. The Person information is saved in the Person table, along with the primary key of the Address created in 1.
  3. The user never touches/sees any primary keys.

I think my confusion is coming from the fact that I am expecting the IDE to do more coding than it’s supposed to; If I had to quickly hack this, I’d probably add a click event to the “save” button that first calls SaveChanges() on the Address followed by the Person. Is that the best practice, or is there a more accepted way of doing this?

  • 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-15T10:43:05+00:00Added an answer on May 15, 2026 at 10:43 am

    You shouldn’t have to do a lot extra. But you should call SaveChanges on the DataContext common to Address and Person (to correctly handle the different insert/delete scenarios).

    You should simply delete all controls (columns) relating to the Keys.

    Are you having a specific problem?

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

Sidebar

Related Questions

I'm very new to Entity Framework, that's my disclaimer! I have a SQL 2008
I am very new to ADo.net entity framework and i am getting the following
I am very new to Ruby so could you please suggest the best practice
[ I am new to ADO.NET and the Entity Framework, so forgive me if
I have a .NET 4 WinForms app that uses the ADO.NET Entity Framework. Some
Very new to using Raphael.js I'm looking at the tutorials and I am able
Very new mobile developer here... I am trying to retrieve a list of tweets
I very new to Python, and fairly new to regex. (I have no Perl
Im very new to all coding including jquery. I though this would have been
I have a SQL Server database and I'm using ADO.NET ExecuteReader to get a

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.