Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have application running in 32 bit mode. it tries to connect oracle DB using Oracle Client. Oracle Client is running in 64 bit.

string connectionString = @"Data Source=" + oracleDBName + ";User id=" + oracleDBUserId +";Password=" + oracleDBPwd +";";
            OracleConnection con = new OracleConnection(connectionString);
            try
            {
                con.Open();
                if (con != null)
                {
                    con.Open();
                }
                return true;
            }
            catch (OracleException)
            {
                return false;
            }

I am getting targetinvocationexception when i call

con.Open();

Reason, It is not able to load 64 bit dll since the application is running in 32 bit mode.

I cannot change the application mode. I also cannot install the 32 bit Oracle client. How to solve this problem

Thanks in Advance

share|improve this question
    
You need the 32-bit Oracle client (OCI) for a 32-bit process and the 64-bit Oracle client for a 64-bit process, there is nothing else to do. –  Simon Mourier Aug 27 '12 at 15:58
1  
You cannot change the application mode, you cannot install the 32 bit client, you cannot write your app. –  Steve Aug 27 '12 at 15:59

1 Answer 1

Oracle driver for .NET "requires native" client from Oracle. (It's not Java, where thin client exists)

Try instant client, it doesn't require installation. http://www.oracle.com/technetwork/topics/winsoft-085727.html

Also, you can try ODBC .NET driver, but configure ODBC DSN to use Oracle driver from Microsoft (most windows installation has microsoft's odbc driver for oracle out of the box). Again:
1) for 32bit application you need 32bit version of ODBC
2) oracle instant client should be available in the search path

In Windows 64bit there are two versions of ODBC admin panels for 32bit and 64bit applications. To run 32b version execute C:\Windows\SysWOW64\odbcad32.exe.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.