Solved

C# OracleConnection exception

Posted on 2014-10-20
3
272 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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