1

Alright first i apologize if i used any wrong terms. my problem is that i created a database then i made the models out of it (database first approach) afterwards I've added a new table called "accounts" for example.

of course i cannot use it in the controller like

var x = db.accounts.Tolist();

because its not included in the models.

i tried to "update the model from the database" from the model design panel but it didn't create any new class for the new table..

any idea ?

1 Answer 1

1

You need to make sure that on the "Add" panel, you select the new table you want to add:

enter image description here

Sometimes I find that when I have problems it's easiest to just delete all the tables from the edmx and re-add them all, or even just to re-create the edmx in its entirety.

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

7 Comments

at the first time i checked it, but i cant check it if i try to update it again.
@user2962142 It must have added it in some capacity then. Try my second suggestion - delete all the tables and re-add them all.
Mansfield i tried it, even the deleted tables didnt come back. @Tassadaque im adding a new table not modifying it.
@user2962142 Are you sure you're connecting to the right database?
@user2962142 Try creating a new .edmx from scratch then, and see what happens. Also, are you on sql server? If so, what version?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.