Auto Ad Code

Thursday, August 9, 2012

No mapping specified for the following EntitySet/AssociationSet

You can get this error when you have generated your Entity Model from a database.
This error means that due to any issue (update/delete etc) the Entity mappings are not same as the Database.

Solution

There can be seen many solutions to this problem over internet but the best solution as far as I know is
1. Double Click the edmx file to open the Entity Model in design view.
2. Press Ctrl A to select all objects within Entity Model.
3. Now press Delete to delete all objects.
4. Again generate your Entity model from Database using "Update Model from Database" option given in context menu (Right Click).
5. All done.

Hope this will help.


Happy Coding :)

6 comments:

  1. realy good soltion to generate all complex type again

    ReplyDelete
  2. Thanks Dude.... it worked.

    ReplyDelete
  3. Excellent Solution. Saved me more hours troubleshooting this stuff. Thanks.

    ReplyDelete
  4. Great and simple way!!! thank you!!!

    ReplyDelete