Solved

C# OracleConnection exception

Posted on 2014-10-20
3
259 Views
Last Modified: 2014-10-21
Hi:

I took over a C# solution from someone who has left the company.  There were a few dlls missing from the solution. I downloaded them using NuGet in order to make the projects compiled and built. However, when I run one of the projects, an exception is thrown:
Error Message:
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.      
InnerException:
"The provider is not compatible with the version of Oracle client"

Can anyone please point me to a direction of how to resolve this issue?
I am running my code using VS2012 targeting C# 4.0 and x86 plateform.
My machine is Windows 7 64-bit.
The version of Oracle.DataAccess.dll I downloaded is x86 2.112.1.0.

Thanks.
0
Comment
Question by:sdc248
3 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40393699
64-bit Oracle Data Access Components (ODAC)
32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio

use the 32bit for Entity framework

If you get the exception 'The provider is not compatible with the version of Oracle client', don't stress, simply retrace your steps and make sure you get ALL those DLL's from the same ODP.Net / ODAC distribution to avoid version number conflicts, and put them all in the same folder as your EXE (or, in the Bin folder if its an Asp.Net application, then try restarting IIS). If you download a newer version of ODP.Net, the jar files that enclose the dll's may have moved, so you'll have to manually search through them all, don't worry it won't take *too* long!
http://www.splinter.com.au/using-the-new-odpnet-to-access-oracle-from-c/
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 40394168
TRY TO INSTALL ORACLE CLIENT CORRECT VERSION

TRY TO USE 32 BIT
0
 

Author Closing Comment

by:sdc248
ID: 40394826
Downloaded 32-bit ODAC to my machine and the problem solved. Thank you.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question