Page 1 of 1

Unable to determine the provider name for connection of type

Posted: Tue 31 May 2011 18:27
by jeffkrueger
Hello,

I am trying to get the demo version of the dotconnect working with entity framework 4.1, using code first. I am trying to run this through a unit test project. So the app.config of my unit test has the following.

Code: Select all

<connectionStrings>
    <add name="BIL.ORM.EF.Properties.Settings.EnterpriseConString" connectionString="DATA SOURCE=xxx;PASSWORD=XXXX;USER ID=XXXXX" providerName="Devart.Data.Oracle" />
  </connectionStrings>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle"
       description="Devart dotConnect for Oracle"
       type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle,
       Version=5.35.57.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
In the bin directory I have Devart.Data.Oracle.dll, Devart.Data.dll, Devart.data.oracle.entity.dll.

But yet every time I run I get

Unable to determine the provider name for connection of type 'Devart.Data.Oracle.OracleConnection'.

The one thing I don't have is a license file. I am trying out the 30 day deal. Is this an expected error for no license file? I did try to create just a text file and add it to my project called licesnse.licx and list to the two dll's as stated in the doc. But that didn't work either same error.

FYI I have the oracle beta working, but I am hoping for a easier install during deployment. My hope was to change the connection string, list the factory, include the dll's and be off an running. No such luck so far. :(

Thanks
Jeff

Posted: Wed 01 Jun 2011 11:26
by AndreyR
The Code First support was added since 6.10.141 build of dotConnect for Oracle.
If you are using this or a more recent build, please replace the version 5.35.57.0 by the actual one.
Please refer to the Code First Support article for more infrormation (it contains a working sample as well).

Posted: Wed 01 Jun 2011 13:21
by jeffkrueger
Thank you for the reply. This was a brand new download of the demo version from your website. So I assume it was the latest version. I did not install any of the tools for visual studio. No other versions of DevArt exists on my machine, brand new install basically.

So I assume this is not a valid error for a missing license file?

Thanks

Jeff

Posted: Wed 01 Jun 2011 14:17
by AndreyR
License errors usually contain "License error" in the error message.
This error seems to be a Code First error. Usually it is associated with connection handling in your code.

Posted: Wed 01 Jun 2011 15:40
by jeffkrueger
"Conection Handling"

Is there anything more to do than:
Make sure the 3 dlls are available.
Define the factory in the web.config / app.config
Setup your connection string that the DBContext is using to use the devart dll as shown in the original post

?

Thanks
Jeff

Posted: Thu 02 Jun 2011 09:02
by AndreyR
The initial error is caused by incorrect provider registration.
The correct registration for the latest 6.30.135 build should look like:

Code: Select all

<add name="dotConnect for Oracle" invariant="Devart.Data.Oracle"
       description="Devart dotConnect for Oracle"
       type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle,
       Version=6.30.135.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
You can find the actual version, for example, in Tools->Oracle->About dotConnect for Oracle menu in Visual Studio.

Posted: Thu 02 Jun 2011 13:27
by jeffkrueger
THANK YOU that did the trick. I didn't install the developer tools so I don't have that menu option in visual studio. This was the link I was using and where I got my code example from.

http://www.devart.com/dotconnect/oracle ... yment.html

I missed Replace 5.35.57.0 here with your actual version. :oops:

My fault.

Once again thank you!

Jeff