0

I am using VS 2012 and I face a strange problem.

When I delete all tables in the .edmx file and then update model from database and add all of tables back, one of my tables is not updated!

I was working on my project perfectly. I faced the problem when I made some changes in the database. However I always made changes in my database and before last time, everything was OK!

What is reason and solution?

8
  • It is not added or not updated? Commented Nov 21, 2015 at 9:38
  • If you already deleted all the tables from your .edmx - try to just delete the whole .edmx and start over - create a new Entity Data Model - does that work? Commented Nov 21, 2015 at 9:41
  • @giorgi-nakeuri: not added! I deleted all tables and add all tables(when updating model) . but one of table not added! Then if i try to update model without deleting all tables, just that one table exist in list to Add! If i add that table, and update the model, problem still exists and that table never add! Commented Nov 21, 2015 at 9:44
  • @MohsenUnlimited, it may happen if you don't have primary key defined on the table. Check that. Commented Nov 21, 2015 at 9:46
  • Is there anything special about the name of the table (or one of its columns)? E.g. is there a space or a special character (exclamation mark, question mark etc.) in the table or one of its column names? Is the table name all digits, by any chance?? Commented Nov 21, 2015 at 9:50

1 Answer 1

4

Most probably the problem is that table in database have no primary key defined. Just create the one and the problem will be solved.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks.Problem solved! But why VS not display any error and notification about updating tables that have not PK?
@MohsenUnlimited, are you sure? I am getting those warnings, like table or view doesnt have pk or something like that. I can not check right now. Try opening edmx in text, xml editor and search for errors. I don't remember exactly where thise errors added. social.msdn.microsoft.com/Forums/en-US/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.