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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

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.

Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75
  • Thanks.Problem solved! But why VS not display any error and notification about updating tables that have not PK? – Mohsen Tavoosi محسن طاوسی Nov 21 '15 at 10:20
  • @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. https://social.msdn.microsoft.com/Forums/en-US/7d9c6ae8-80ff-42e8-ae12-c16d1fd896c3/adding-table-with-no-primary-key-to-entity-model-and-implementing-crud-operations?forum=adodotnetentityframework – Giorgi Nakeuri Nov 21 '15 at 10:24