C# OracleConnection exception

Posted on 2014-10-20
Last Modified: 2014-10-21

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.      
"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

Question by:sdc248
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 81

Accepted Solution

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!
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 40394168


Author Closing Comment

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

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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