私はジュニアの.net開発者です。10gのOracleデータベースサーバーから結果を取得する必要がある単純なクライアントアプリケーション(.net3.5)を開発しました。このアプリケーションは、オラクルがインストールされていないがサーバーにアクセスできる100個の32ビットシステムにデプロイされます。ユーザーが自分のマシンにオラクルをインストールすることは意図していません。それは可能ですか?このリンクに記載されている内容はすべてhttp://www.splinter.com.au/using-the-new-odpnet-to-access-oracle-from-c/をたどったところ、下部に記載されているバージョンの不一致エラーが発生します。リンクの。ユーザーのマシンにOracleクライアントがなくても機能しますか?Oracleがインストールされているため、私のマシンでは正常に機能しています。これを回避する他の方法はありますか?
私のconnectiopn文字列は:
OracleConnection conn = new OracleConnection();
conn.ConnectionString = "User ID=<userid>;Password=*******;Data Source=<data source>";
conn.Open();".
生成される例外は次のとおりです。
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** 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()
at WindowsFormsApplication1.frmVoiceFileMover2.cmdGetId_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: 4.0.0.0
Win32 Version: 4.0.30319.269 (RTMGDR.030319-2600)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
VoiceFileMover2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/State%20of%20Maine/VFM2Setup/VoiceFileMover2.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.278 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.282 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.269 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Oracle.DataAccess
Assembly Version: 2.111.6.20
Win32 Version: 2.111.6.20
CodeBase: file:///C:/Program%20Files/State%20of%20Maine/VFM2Setup/Oracle.DataAccess.DLL
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
開発中のマシンに2つのOracleクライアント10.2と11.2がインストールされています。11.2クライアントから自分のプロジェクトにoracle.dataaccess.dllを参照し、その後、それが機能しなくなったときに、odp.netの最新リリースをダウンロードして再度参照しました。それでもこの例外が表示される場合は、odpを使用してみました。 10gのネットもありますが、10gでoracle.dataaccess.dllが見つかりませんでした。この問題はGACが原因ですか?
また、このリンク「http://www.youtube.com/watch?v=I1q50HnUh_w」に従って、ODP.netマネージドドライバーベータ版を使用してみました。
すべてのマシンにOracleクライアントをインストールする必要がありますか?プロジェクトに必要なdllをパッケージ化して機能させることはできませんか?Instant oracle slientで機能する場合、InstantClientでの作業を続行するにはどうすればよいですか。私の現在の唯一の望みは、10g odp.netにファイルoracle.dataaccess.dllがあり、それがサーバーのoracleバージョンと一致するかどうかを調べて、それを機能させることです。そうでない場合、どのようにOracle Instant Clientを使用できますか?どんな助けでも大歓迎です。