2011-03-21 88 views
1

連接到Oracle我嘗試連接到Oracle從我的C#程序問題,從我的C#的WinForm程序

11.2.0 64位和我得到這個錯誤:

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.

我對連接到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(); 

和我的程序在X86編譯(在64位工作)

我需要什麼牛逼o在我的C#程序中下載或更改?

在此先感謝

+0

你應該發佈你的代碼,否則我們無法幫你改變什麼。 – xdumaine 2011-03-21 20:13:26

回答

3

如果您使用的是Oracle 32位客戶端,您需要從任何CPU到86重建你的應用程序。

+0

我知道這個,但這不是問題 – Gali 2011-03-21 20:53:25

+1

嘗試更改項目 - >屬性 - >生成 - >目標CPU到x86太 – 2011-03-21 20:58:15

+0

看看我的編輯 – Gali 2011-03-22 07:57:13