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

Hi,

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 '2.121.1.0' (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:
 <connectionStrings>
    <add name="ConnectionString" connectionString="DATA SOURCE=DCTM;PASSWORD=passwd;USER ID=REPOSITORY_DEV_DBO" providerName="Oracle.DataAccess.Client" />
  </connectionStrings>

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);
            conn.Open();

            OracleDataReader reader = comm.ExecuteReader();
            datos.Load(reader);

            conn.Close();

            return datos;
        }

Open in new window

LVL 2
José PerezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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:
Agreed:
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?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook 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
ASP.NET

From novice to tech pro — start learning today.