1

i try to connect to Oracle 11.2.0 64bit from my C# program

and i get this error:

Attempt to load Oracle client libraries threw BadImagFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

my code for connect to Oracle

Conect = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + IP + ")(PORT=" + PORT + ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" + Server + ")));User Id=" + UID + ";Password=" + PASS + ";";

Conn = new OracleConnection(Conect); 
Conn.Open();

and my program compile on X86 (for working on 64 bit)

what i need to download or change in my C# program ?

thanks in advance

1
  • You should post your code, or we can't help you with what to change. Commented Mar 21, 2011 at 20:13

1 Answer 1

3

If you are using oracle 32bit client you need to rebuild your app from Any CPU to x86.

Sign up to request clarification or add additional context in comments.

2 Comments

i know this , but this isn't the problem
Try change Project -> Properties -> Build -> Target CPU to x86 too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.