on 2015 May 19 8:06 PM
I am using SQL Anywhere 12.0.1 with VS 2013, the SA ADO.Net driver from the SA 12.0.1.4134 client and the Entity Framework 5 Entity Data Model Wizard... I am trying to create a DB first model using the wizard. After selecting the connection to the SA database and then selecting EF 5 (Don't have an EF6 compatible driver yet), the wizard briefly displays "Retrieving database information, please wait..." then I get the error message:
An error occurred while connecting to the database. The database might be unavailable. An exception of type 'System.Data.Entity.Core.EntityCommandCompilationException' occurred. The error message is: 'An error occurred while preparing the command definition. See the inner exception for details.
The inner exception caught was of type 'System.Data.Entity.Core.MappingException', with this error message: '
StoreSchemaMappingVersion3(3,4) : error 3027: No mapping specified for the following EntitySet/AssociationSet - FunctionReturnTableColumns, FunctionFunctionReturnTableColumns.'.'.
Can anyone help?
Edit: it's the SA 12.5.0.4134 client driver not 12.0.1
Edit 2: Nvm, it is the 12.0.1.4134 client driver
Request clarification before answering.
Visual Studio 2013 comes pre-installed with Entity Framework 6 (EF6) so the version of the Entity Data Model (EDM) wizard that you are using will be Entity Framework Tools 6.x (EFTools) and you are targeting Entity Framework 5 (EF5) with your project in the EF6 wizard. I assume you have done the following in NuGet to force the EF5 version installation in Visual Studio 2013:
Install-Package EntityFramework -Version 5.0.0
The EDM resources that EFTools 6.x are referring to above are the EF6 Provider mappings - these do not exist in EF5:
< AssociationSet Name="FunctionFunctionReturnTableColumns" Association="Self.FunctionFunctionReturnTableColumn">
< End Role="Function" EntitySet="SFunctions"/>
< End Role="Column" EntitySet="SFunctionReturnTableColumns"/>
< /AssociationSet>
So the problem here is that EFTools 6.x seems to be checking for EF6 mappings in what is supposedly an EF5 provider even in this compatibility mode. If you were using Visual Studio 2012 with just EF5 installed (i.e. without the EF6 installation from https://www.microsoft.com/en-us/download/details.aspx?id=40762 ), this same operation is okay as it doesn't check for that mapping. So the error is in EFTools. (I can reproduce this same error with EFTools 6.1.3 in Visual Studio 2013 and I have confirmed this operation is okay in VS 2012).
For your current situation, I would recommend downloading a later 12.0.1 SQL Anywhere SP that includes EF6 support and use our EF6 provider, as per: http://sqlanywhere-forum.sap.com/questions/22161/entity-framework-6-provider
Once the EF6 provider is installed, you can either use EF5 or EF6 in the EFTools 6.x tooling.
I have opened CR #784321 to see if we can address this point of using the EF5 compatibility mode in an EF6 tooling situation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the detailed explaination Jeff. It does seem like the error is in EFTools using EF5 provider but calling EF6 'methods'. (Also, as far as I can tell, the VS2013 default creates projects with EF5 reference. EF6 has to be added/updated with every project)
Is there a publicly availably link to download something newer than the SA 12.0.1.4134 client? (Which I got from: http://scn.sap.com/docs/DOC-35857)
After much wrestling with :
I finally got it working!!
The last piece of the puzzle was the app.config. In the linked forum posting about setting up EF6, the SA 16 provider was used as a sample. I simply (Hah! simply...) had to change the version number to match the version number of the iAnywhere.Data.SQLAnywhere.EF6 DLL on my machine, which was 12.0.1.42314.
I seem to have lost the ability to choose between EF6 and EF5 in the entity data model wizard, but that's no problem. I only tried EF5 initially because I didn't have the EF6 driver yet.
User | Count |
---|---|
74 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.