ASP.Net/C# 'OracleException (0x80004005): The provider is not compatible with the version of Oracle client'


our scenario is the following:
We are developing a webSite in ASP.Net /C#. This webSite should be quering an Oracle 11g server installed on a Windows 2008 R2 server.

The client provided an exact same version of their server with the only difference it is a 32 bit version of Windows.
We developed the WebSite in a windows 8.1 pro machine with Visual Studio 2013 and Oracle client 11g 32bit version added to the project as a 'Reference', and it works perfect.

Now, when we went to deploy the webSite in their production server we received an error "[OracleException (0x80004005): The provider is not compatible with the version of Oracle client]".

After checking everything we have notice 2 differences:
1. It is a 64 bit version of Windows Server 2008 R2.
2. Its Oracle client version is 64 bit which references to Oracle.DataAccess component version 4.x...

In our development machine we use the 32 bit version which references to Oracle client library '' (Oracle.Dataccess.dll)

We suspect of the ConnectionString but we don't know how to convert it to a 64bit one.

in 'Web.Config file' we have:
    <add name="ConnectionString" connectionString="DATA SOURCE=DCTM;PASSWORD=passwd;USER ID=REPOSITORY_DEV_DBO" providerName="Oracle.DataAccess.Client" />

Open in new window

in our 'DBManager.CS' file we have:
        public DataTable ExecuteSqlGet(String sql)
            DataTable datos = new DataTable();

            OracleConnection conn = new OracleConnection();
            conn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

            OracleCommand comm = new OracleCommand(sql, conn);

            OracleDataReader reader = comm.ExecuteReader();


            return datos;

Open in new window

José PerezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnsoneSenior Oracle DBACommented:
I believe you need the 32-bit version of the Oracle client.  The bit version needs to match the application, not the operating system.  Since it seems to be working with 32-bit version of the client on another machine, I would suspect the application is 32-bit.
slightwv (䄆 Netminder) Commented:
The OS Bit version doesn't matter.  It is the apps that reference DLLs on the system.

32Bit apps need 32Bit drivers.
63Bit apps need 64Bit drivers.
José PerezAuthor Commented:
You mean I should compile as 64 bit?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

johnsoneSenior Oracle DBACommented:
Either compile as 64-bit or install the 32-bit drivers.

If the target machine that will be running the application is only running a 32-bit operating system, then you need to compile 32-bit and install the 32-bit drivers.
slightwv (䄆 Netminder) Commented:
To add:  Even though you didn't mention it, I would stay away from AnyCPU.  Pick the target Bit version and stick with it.
José PerezAuthor Commented:
Stay away from 'Any CPU'?
slightwv (䄆 Netminder) Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.