I'm trying to add a new ADO.Net Entity Data Model to an MVC project I am working on.
When I complete the wizard, choosing my db and tables (just a single table for now) I get an error ""Exception has been thrown by the target of an invocation." and it throws me back the add new item dialog.
At this point, an empty Data Model has been created in my project. If I then choose "Update Model From Database" and complete the wizard again, I get a similar error.
An exception of type 'System.Reflection.TargetInvocationException' occurred while attempting to update from the database. The exception message is: 'Exception has been thrown by the target of an invocation.'.
Any ideas? I have tried doing this in an empty project also and still no dice!
Alex
Right-click the Models folder in the Solution Explorer window and select the menu option Add, New Item. In the Add New Item dialog, select the Data category (see Figure 1). Select the ADO.NET Entity Data Model template, give the Entity Data Model the name MoviesDBModel. edmx, and click the Add button.
Thus, you can create an Entity Data Model file (. edmx) for your existing database. You can open an EDM designer in XML view where you can see all the three parts of the EDM: Conceptual schema (CSDL), Storage schema (SSDL) and mapping schema (MSL), together in XML view.
You could try creating the Entity Data Model manually using the EdmGen.exe tool. Hopefully that will give a bit more information about the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With