last day (14 days later) » 

5:57 AM
0
Q: Referenced table is not coming in my model through entity framework 5.0

Ashish JainI 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 ...

 
There must be a constraint active on that table and its not found while creating the model and hence, the error. You might want to check that in your SQL by checking the CREATE script of that table.
 
tblUser_setting using tblUser_info => user_id (primary_key ) as foreignKey. so do you mean to remove this constraint ?
 
Is tblUser_setting referenced by some other table in your database in any way ?
 
No, it is not referenced by any other table.
 
Try for once, removing the tblUser_info foreign key constraint from that table and check if it works.
 
5:57 AM
ok, i check again and let you know.
i tried but its not working.
this time i havn't get error but not found tblUser_setting table also as usual.
 
Try this, CTRL+A all the entities in your model, delete them and update model from database again entirely.
 
Tried but not worked.
 
Double check if the table is present in the context.cs file and if it only not showing in your designer view.
 
No, this table also not present in context.cs, i don't think sql server version will make any differece, right now i am using VS2014 express (due to company requirement)
 
Right click on your designer view and then on Update model from database. After that a window will open and there click on refresh and then on tables and then finish. Check if that works.
 
5:57 AM
before pressing finish i can see In Refresh tab that table is not visible, and after pressing finish, i can't see that table in designer.
 
If its possible, just delete that table from SQL server, recreate it and then try to update your model entirely again.
 
yes that i can try and let you know.
I deleted and recreated table then made foreginkey and then attached from entityFramework and this time also not worked.
 
Did it show that error it was showing previously /
 
Ohh yes, i have not paid attention on that, this time no error but table is missing.
 
Lol. This is getting interesting. Never experienced such stuff. See this link and follow steps : stackoverflow.com/questions/28572125/…
 

last day (14 days later) »