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:

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

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:

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!
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” …