Solved

C# OracleConnection exception

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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