Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 19 May '15, 19:06

voonliew's gravatar image

voonliew
106333
accept rate: 25%

edited 20 May '15, 12:17


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.

permanent link

answered 21 May '15, 10:45

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

edited 21 May '15, 11:01

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)

(21 May '15, 13:01) voonliew
2

After much wrestling with :

  • Getting our SAP S-user access to download the SQL Anywhere EBF
  • Actually downloading the EBF file (3 attempts with a regular HTTP download got cut off mid way). The SAP download manager app did not work.
  • Figuring out how to install the client drivers. They weren't listed in the installer. Turns out they were installed as part of the SQL Anywhere database server option. I didn't need the SA engine on my dev PC but whatever...
  • Uninstalling the previous SA 12.0.1.4134 client for good measure.
  • Some app.config - err - configuration...

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.

(29 May '15, 16:42) voonliew

As there is no other answer so far, and since there have been some fixes for SA 12.0.1 and VS 2012/2013 lately, I'd suggest to try the newest EBF.

For a list of potential fixes, cf. that public link:

SA 12.0.1.4224 EBF Readme, particularly the section on the ADO.Net Managed Provider.

Note: I don't know whether that will solve your problem, it's just a recommendation.

permanent link

answered 20 May '15, 16:11

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

edited 21 May '15, 06:07

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×69
×63

question asked: 19 May '15, 19:06

question was seen: 3,732 times

last updated: 29 May '15, 16:47