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
Connection String / Database Provider for EF 6 Code-First
-
- Posts: 3
- Joined: Wed 01 Oct 2014 14:20
-
- Posts: 3
- Joined: Wed 01 Oct 2014 14:20
Re: Connection String / Database Provider for EF 6 Code-First
Hi Shalex,
I already followed the advise in the first article. I registered the provider in the Web.config like this:
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.
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>
(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.
-
- Posts: 3
- Joined: Wed 01 Oct 2014 14:20
Re: Connection String / Database Provider for EF 6 Code-First
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
Richard
Re: Connection String / Database Provider for EF 6 Code-First
That is correct.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