Solved

C# OracleConnection exception

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

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
Comment Utility
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
Comment Utility
TRY TO INSTALL ORACLE CLIENT CORRECT VERSION

TRY TO USE 32 BIT
0
 

Author Closing Comment

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now