Search code examples
c#asp.net-mvc-4entity-framework-5sql-server-2014sql-server-2014-express

Referenced table is not coming in my model through entity framework 5.0


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.


Solution

  • 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.