Hello,
I have developed a client server application targeting 3.5 framework and followed this link
Instant Oracle Using C#[
^] to connect to the oracle database on server.
But i'm getting "Provider is not compatible with the version of oracle client" exception. I'm working on windows 7 32 bit pc which does not have any oracle client installed. As said in the link i have placed the dlls including oraops.dll(not mentioned in the article) in the directory where exe files exist.My connection string is:
conn.ConnectionString = "User ID=macw_conv;Password=blaster2;Data Source=(DESCRIPTION=" +
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=moeprodv4.dafs.state.me.us)(PORT = 1530))"+
"(CONNECT_DATA=(SID=macwprod)(SERVER = DEDICATED)));";
I wasn't sure if this would work so i added tnsnames.ora as well. Server has oracle 10g database and the dlls are from the current release 11.2. Do I have to make changes to config file? I'm unable to figure out what the problem is ?
The type initializer for 'Oracle.DataAccess.OracleConnection'threw an exception.
Stack trace is:
<pre lang="text">System.TypeInitializationException was unhandled
Message=The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
Source=Oracle.DataAccess
TypeName=Oracle.DataAccess.Client.OracleConnection
StackTrace:
at Oracle.DataAccess.Client.OracleConnection..ctor()
at WindowsFormsApplication1.frmVoiceFileMover2.cmdGetId_Click(Object sender, EventArgs e) in C:\Users\deepthi.motkur\Desktop\VoiceFileMover2\VoiceFileMover2\Voice File Mover.cs:line 271
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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in C:\Users\deepthi.motkur\Desktop\VoiceFileMover2\VoiceFileMover2\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: Oracle.DataAccess.Client.OracleException
Message=The provider is not compatible with the version of Oracle client
Source=Oracle Data Provider for .NET
ErrorCode=-2147467259
DataSource=""
Number=-1011
Procedure=""
StackTrace:
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
InnerException:
Any help is apprciated..
Thanks