able to connect to Oracle via Samples app but not via CrmDemo

able to connect to Oracle via Samples app but not via CrmDemo

Postby cResults » Fri 09 Nov 2012 19:02

I have been charged with making a prototype of a project work with dotConnect for Oracle and Entity Framework Code First prior to my manager authorizing the purchase of a license.

Utilizing "dotConnect for Oracle Samples - DataReader", everything seems to work via a Direct Connection.

Code: Select all
Open connection: "User Id=testDBadmin;Server=serv08oracle11;Direct=True;Sid=xe;"
Taking connection from connection pool: "User Id=testDBadmin;Password=admin;Server=serv08oracle11;Direct=True;Sid=xe"
Connection is taken from pool. Pool has 1 connection(s).
Prepare: SELECT * FROM Dept
Execute: SELECT * FROM Dept

Returns:
DEPTNO        DNAME         LOC           
-----------   -----------   -----------   
10            ACCOUNTING    NEW YORK      
20            RESEARCH      DALLAS        
30            SALES         CHICAGO       
40            OPERATIONS    BOSTON   

However, when I try to run CrmDemo.EFCodeFirst.dcOracle project with the same connection string, it throws "The provider did not return a ProviderManifestToken string." with an inner exception of "Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server."

I've search through your site and read every post associated with different combinations of word from the error messages with no success of finding a solution.

I downloaded docConnect Pro (Devart.Data.Oracle version 7.2.114.0). Nuget updated the CrmDemo project to EF 4.4.0.

Additionally, which of the following is correct? Neither combo resolves issue above, but would like to know which is correct:

C:\Program Files (x86)\Common Files\Devart\dotConnect\5.0\Net2\Common\Devart.Data.Oracle.dll & Devart.Data.dll
OR
C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.Oracle.dll & Devart.Data.dll

Please let me know if have any questions.

Respectfully,

David C
cResults
 
Posts: 17
Joined: Fri 09 Nov 2012 17:52

Re: able to connect to Oracle via Samples app but not via CrmDemo

Postby cResults » Mon 12 Nov 2012 20:19

The documentation for implementing CrmDemo.EFCodeFirst found at http://blogs.devart.com/dotconnect/entity-framework-code-first-support-for-oracle-mysql-postgresql-and-sqlite.html

states
You can set up a connection string for DbContext in different ways.
It can be placed into the app.config (web.config) file.
The connection string name must be identical to the DbContext descendant name.


Because that is how I always set up the connection string for EF projects, my brain checked out while reading the paragraphs that followed. Therefore, I totally missed
And now it is possible to create an instance of the provider-specific connection
and send it to the context constructor, like we did in this application.
That allows us to use the StateChange connection event to change the Oracle
current schema on its occurrence. Thus, we can connect as one user and
work on a schema owned by another user.
---------------------------------------------------------------*/
DbConnection con = new Devart.Data.Oracle.OracleConnection(
"Data Source=ora1020;User Id=scott;Password=tiger;");
con.StateChange += new StateChangeEventHandler(Connection_StateChange);


LESSONS LEARNED:
    Read the documentation while paying attention :shock:
    It is futile to make multiple changes to a connectionString that is never used and expect different results :oops:

The following appears to be the correct dlls:
cResults wrote:C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.Oracle.dll & Devart.Data.dll
cResults
 
Posts: 17
Joined: Fri 09 Nov 2012 17:52

Re: able to connect to Oracle via Samples app but not via CrmDemo

Postby Shalex » Tue 13 Nov 2012 15:36

Thank you for letting us know that the issue is solved.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle