Connection String / Database Provider for EF 6 Code-First

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Richard Parker
Posts: 3
Joined: Wed 01 Oct 2014 14:20

Connection String / Database Provider for EF 6 Code-First

Post by Richard Parker » Wed 01 Oct 2014 14:26

Hi,

I'm using Entity Framework 6 with Code-First approach in an MVC5 application. I already have a model and a DbContext that works with SQL Server. I'm trying to change my connection string to connect to an Oracle DB using dotConnect for Oracle. Where can I find the information I need to create a connection string and register the Database Provider?

Thanks,
Richard


Richard Parker
Posts: 3
Joined: Wed 01 Oct 2014 14:20

Re: Connection String / Database Provider for EF 6 Code-First

Post by Richard Parker » Wed 01 Oct 2014 15:25

Hi Shalex,

I already followed the advise in the first article. I registered the provider in the Web.config like this:

Code: Select all

  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.244.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
The error I get says: 'Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.244.0, Culture=neutral, PublicKeyToken=09af7300eec23701' does not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Perhaps it does not support Entity Framework 6 or higher. More information is available at http://go.microsoft.com/fwlink/?LinkId=260882
(It's not the original error, but a translation from the German error message I got)

Another issue that is not covered in the articles is how does the connection string look like?

Richard


Edit: I forgot to mention that the EF6 package is already installed because it's a default MVC 5 web application.

Richard Parker
Posts: 3
Joined: Wed 01 Oct 2014 14:20

Re: Connection String / Database Provider for EF 6 Code-First

Post by Richard Parker » Wed 01 Oct 2014 15:58

I guess I figured it out. You need to use the revision number 6 instead of 0 in the <providers> section but you need to use 0 in the <DbProviderFactories> section. So for me it's 8.4.244.0 and 8.4.244.6

Richard

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Connection String / Database Provider for EF 6 Code-First

Post by Shalex » Wed 01 Oct 2014 16:12

Richard Parker wrote:You need to use the revision number 6 instead of 0 in the <providers> section but you need to use 0 in the <DbProviderFactories> section. So for me it's 8.4.244.0 and 8.4.244.6
That is correct.

Post Reply