I'm learning MVC3. There is something I'm trying from many hours and now I think I'm totally lost. I created a database first, then generated Models from it. Now I wanna know if it is possible to use scaffolding to generate a model with CRUD views? I tried several things. Firstly the error- Unable to get metadata. Googling it first misled me that there is something wrong with EF4.x. Reinstalled it and wasted time. Then I tried Automatic Code Generation feature but its giving ambiguity errors between previously generated classes. Is it even possible to do what I'm trying? How? Or do I have to code for the views?
Asked
Active
Viewed 76 times
1 Answers
0
Go to your controller method, right click and add your view, You will need to check strongly typed-view then select the model and the scaffold template.
If you still get an error, make sure you decorate the primary key with the attribute [key], also make sure all properties have the same name as your DB field or you will get an error.

meda
- 45,103
- 14
- 92
- 122