1

I'm was told recently that in our current project we have to use Oracle instead of SQL Server.

I need some help to make it work. I've already installed Visual Studio ODTwithODAC but when I try to run the command update-database in the Package Manager Console, the following error is thrown:

A null was returned after calling the 'get_ProviderFactory' method on a store provider instance of type 'System.Data.OracleClient.OracleConnection'. The store provider might not be functioning correctly.

I know that the problem is not the access to DB because I could connect to it via Server Explorer and I took the connection string from it.

My connection string goes like this:

<add name="LpssContext" 
     connectionString="SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.1.106)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));uid=sys;pwd=sys;" 
     providerName="System.Data.OracleClient" />

Any ideas about what's wrong?

Does Oracle support code-first migrations?

7
  • 1
    I think your providerName should be something else than System.Data.SqlClient Commented Oct 7, 2013 at 19:16
  • provider=System.Data.SqlClient? Commented Oct 7, 2013 at 19:16
  • shouldn't be providerName="System.Data.EntityClient" ? Commented Oct 7, 2013 at 19:18
  • The provided connection string and message was updated. SqlClient won't work because this is Oracle. EntityClient didn't work Commented Oct 7, 2013 at 19:21
  • 1
    As far as I know Oracle doesn't support code-first: forums.oracle.com/thread/2558851 Commented Oct 7, 2013 at 19:39

1 Answer 1

1

Currently there's no support for CFM with Oracle connector. There's a paid connector that support it though, http://blog.devart.com/entity-framework-code-first-migrations-support-for-oracle-mysql-postgresql-and-sqlite.html

The other option is to change your db layer to DB First (with lots of work) manually, as I finally did

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.