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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:25:24+00:00 2026-06-09T03:25:24+00:00

I am fairly new to ADO.NET. I am ok with all the basic INSERT,

  • 0

I am fairly new to ADO.NET. I am ok with all the basic INSERT, etc. But now, I have a problem inserting a record into a table that contains a foreign key. I have done some research but am still stuck … so here goes:

I want to INSERT a new record into a table called Professionals. It has a foreign key mapped to a different table. The FK is WAPublicUserID.

See Image:

enter image description here

When I create a data model, the WAPublicUserID isn’t listed in the Properties of the Professional data model.

See Image:

enter image description here

Therefore, when I try to create an INSERT in my code, the WAPublicUserID field can’t be found and I can’t insert the record. The WAPublicUserID that I wish to use already exists in the WAPublicUser table that the FK is mapped to.

See Image:

enter image description here

How do I go about Inserting a new record in the Professionals table that contains a foreign key to an existing record in the WAPublicUser table? 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-09T03:25:25+00:00Added an answer on June 9, 2026 at 3:25 am

    OK, here’s the real answer to my OP:

    The asp.net website that I took over to manage was targeting .NET 3.5. Apparently, there are some issues with 3.5 and Entity Framework.

    I converted the website to target .NET 4.0(*see below to see how). When I went to create the entity data model, voila , by default, it now included the Foreign Keys and therefore, I did not have any issues as described in OP.

    If you run into this situation, you have to make sure that the web server is also upgraded to .NET 4.0. Because if you upgrade/convert the website files to target .NET 4.0, but your web server hasn’t been upgraded, then although the website runs smooth on your dev machine (assuming that it has .NET 4.0 framework), it will crash on the live web server.

    As an aside, .NET 4.0 framework will run apps that were built using previous versions of .NET (backward compatibility) … however, an app that targets .NET 4.0 will not run in an environment with .NET 3.5 framework or prior.

    CONVERT WEBSITE TO .NET 4.0:

    Two ways to convert/upgrade website to .NET 4.0. 1) Usually, when you open a fresh copy and it’s targeting 4.0, visual studio will ask if you want to convert/upgrade (Choose YES). 2) Within visual studio (commercial version), click WEBSITE tab, START OPTIONS, BUILD … then you should see the options to change the “Target Framework” …

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

Sidebar

Related Questions

Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
I am fairly new to php and mysql but I have created a small
im fairly new to databases in vb.net and i have just learned how to
Fairly new to Jquery here.... but one thing I have been told and being
I'm fairly new to programming in general but have been working with Java for
Fairly new to backbone, so this is a really basic question. I have a
I am new to fairly new to AS3 and I have found myself needing
I'm fairly new to C++ standard library and have been using standard library lists
Fairly new to socket programming, but I've been assigned with a whopper of project.
Being fairly new to C++ I have a question bascially concerning the g++ compiler

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.