I am using MVC 4 and entity framework 5.0, i have a database and this database contains 6 tables named as following.
tblUser_family
tblUser_location
tblUser_info
tblUser_photo
tblUser_settings
tblUser_social
when i am creating the .edmx file then only 5 tables are coming in designer one table "tblUser_settings" is not coming, while all tables are connected through foreginKeys.
I am getting following error
Error 1 Error 6004: The table 'Community.dbo.tblUser_settings' is referenced by a relationship, but cannot be found.
Open edmx file, right click anywhere in the modal and select "Update Model from Database" and follow the instructions and choose the desired tables and SPs. Sometimes even after following these steps, your model will not get updated, close Visual Studio and restart it again.
The easiest way to resolve this issue is to right click on the Entity Model and choose "Update Model From Database". Then select the "Refresh" tab and find and select only the table you wish to map a column for. Click the Finish button and you should have everything properly mapped.
Recently i have resolved my issue, problem was i had a main table which has a primary key, and that primary key was mapped with my missing table's column in that column i set "Allow null", as i changed "Allow not null", and update my data model from Entity framework 5.0, it was visible in my solution.
Thank you for all suggestions.
I had this problem, in my case I didn't have created the primary key to my table, so I just set it and I could update my EDMX.
make sure you have "not null" in the declaration of FK
My issue was when creating the foreign keys I didn't specify NOT NULL. I made the change and the table imported just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With