Switch from DirectMode to OracleClient Mode

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rednose84
Posts: 9
Joined: Wed 10 Nov 2010 08:07
Contact:

Switch from DirectMode to OracleClient Mode

Post by rednose84 » Wed 15 Jun 2011 08:15

Hy @all!

I want to change the connectionStirng in my web.config from a direkt one to a connString which is using the installed oracleclient. (its needed for connection to a dataguard managed database for productive system)

So i want to change this types once with direktmode and sometimes the clientmode. If I specify the connectionstring to use oracleclient, i get an connection, but the tables / views are not found. (perhaps the tables are still in database).

Only if I renew the *.edml (with non direct mode) its working fine. But I don't want do generate the Model everytime. In this case I can't change easily the connString to DirectMode. I get also some errors.

Pls some help.

kind regards

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 15 Jun 2011 12:34

I have performed a test and succeeded in switching between two (OCI and Direct) connection strings using the following code:

Code: Select all

      using(var context = new AndreyrEntities()) {
        var q = from d in context.DetailTables select d;
        Console.WriteLine(q.Count());
      }
      using(var context = new AndreyrEntities("name=OCI")) {
        var q = from d in context.DetailTables select d;
        Console.WriteLine(q.Count());
      }
The connection strings were pointing to the same server.
I recommend you to check that the user name and password are the same for the Direct and OCI connections, and that the server name in tnsnames.ora is correct and points to the server that was used in the Direct connection.

Post Reply