我正在使用Visual Studio 2008速成版,並且正在嘗試使用Oracle.DataClient開發小型應用程序。 嘗試連接到目標系統中的數據庫時,出現上述錯誤。當使用Oracle.DataClient時,提供程序與Oracle客戶端錯誤版本不兼容。使用Oracle.DataClient
我已經添加了對Oracle 10gR2的Oracle ODP.net提供程序的引用,並且在目標機器上安裝了Oracle 10gR2數據庫的副本。儘管如此,我收到了錯誤。 在發佈之前,我在SO處閱讀this post,並且我安裝了即時客戶端,錯誤仍然存在。 下面是完整的錯誤堆棧。
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle client at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
at Employees1.frmLogin.oralogin()
at Employees1.frmLogin.btnTest_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
API Data Conversion Assistant
Assembly Version: 0.0.0.1
Win32 Version: 0.0.0.1
CodeBase: file:///C:/Documents%20and%20Settings/3i/My%20Documents/My%20Dropbox/Sathya's%20dropbox/VisualStudio%20Releases/APIDataconversion/Application%20Files/API%20Data%20Conversion%20Assistant_0_0_0_3/API%20Data%20Conversion%20Assistant.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Oracle.DataAccess
Assembly Version: 2.102.2.20
Win32 Version: 2.102.2.20
我有我開發的應用程序的計算機上安裝了Oracle 11g中,它工作正常存在,但在目標機器上,我得到這個錯誤。 任何輸入將不勝感激。
PS:如上所述,引用的Oracle.DataClient.dll文件版本對應於10gR2,而不是11g。
(從 'ociw32.dll.dbl' 重命名)這將是如果回答問題的人會在評論中提供他們的理由,那麼這很不錯... – DCookie 2009-08-10 16:15:23
我認爲這是一個很好的問題,因爲我整個上午都在同一個問題上掙扎。 – Chris 2009-08-11 03:15:32