0

I have one table in the database with the name "Users", a year ago one of the developers added a model using database-first approach, and I don't know which entity framework version they used.

Now i want to change some of the fields datatypes in SQL.

The problem is that I am not able to update model using the refresh window and also tried to delete model and add it again, but after that there was a name that has been changed in Users to User. The current entity framework version is 6.1.3

Ricardo
  • 29
  • 5
  • This is what to do, Open the edmx file in the browser view, make sure your web.config has the right connection to the database you want to use in updating your edmx file, right-click and select `Update Model From Database...`, a window pops up, expand the `tables` node and you should see your tables there select the ones you which to add an click `Finish` – Bosco Jun 28 '19 at 18:26
  • Well, as you see there's plenty confusion as to what you did, because I think you already did most of the things people describe here. So please describe the exact steps you made when trying to update or re-add the model including all options you chose. – Gert Arnold Jun 28 '19 at 21:50
  • there is one field datatype is INT and now i change it into nvarchar(MAX), now, i update the model but it not updated it is always taking a int field, i tried using delete table from entity modal and add table, using of this i able to add field but that time my table name has been changed from Users to User. earlier in model my class name is Users. Thanks. – Pragnesh Patel Jul 01 '19 at 10:06

2 Answers2

0

Just go to your DataBase.edmx and right click "Update Model from Database..." and then refresh the tables

Ricardo
  • 29
  • 5
  • there is one field datatype is INT and now i change it into nvarchar(MAX), now, i update the model but it not updated it is always taking a int field, i tried using delete table from entity modal and add table, using of this i able to add field but that time my table name has been changed from Users to User. earlier in model my class name is Users. Thanks. – Pragnesh Patel Jul 01 '19 at 10:08
0

For the table name check link please -> What is the meaning of the "Pluralize or singularize generated object names" setting?

And Ricardo has already written the update.

severus_92
  • 88
  • 5