Jump to content
  • Advertisement
Sign in to follow this  
zhebincong

[.net] no-touch deploy db access winform

This topic is 5123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello i write a winform app,in the form there is a datagrid and a button.when i click the button,it connect to the oracle,and retrieve the data to display them in the datagrid.the button click event code as following: private void button1_Click(object sender, System.EventArgs e) { DataSet dataSet1=new DataSet("dataset1"); String connectionString="Data Source=zbcdb;User Id=scott;Password=password;"; OracleConnection connection1=new OracleConnection(connectionString); OracleCommand command1=new OracleCommand("select * from emp"); command1.CommandType=CommandType.Text; connection1.Open(); command1.Connection=connection1; OracleDataAdapter oracleDataAdapter1=new OracleDataAdapter(); oracleDataAdapter1.SelectCommand=command1; oracleDataAdapter1.Fill(dataSet1,"emp"); dataGrid1.SetDataBinding(dataSet1,"emp"); } both the visual studio and oracle database are installed in my machine,when i try it in my machine,it works well,but after i copy the "exe" file to the iis(NO-TOUCH DEPLOYMENT),and call it from the OTHER client machine,the following exception is thrown: ************** Exception Text ************** System.DllNotFoundException: Unable to load DLL (oci.dll). at System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject, Boolean& isInTransaction) at System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction) at System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString parsedConnectionString, Object transact) at System.Data.OracleClient.OracleConnection.Open() at ch10_01.Form1.button1_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.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** ............................................. ............................................. ............................................. .............................................. ---------------------------------------- System.Data Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll ---------------------------------------- .................... ................... ---------------------------------------- System.Data.OracleClient Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.data.oracleclient/1.0.5000.0__b77a5c561934e089/system.data.oracleclient.dll ---------------------------------------- .......................... ........................... ............................ as you can see,the client can't find the "oci.dll",because i haven't installed the oracle client software in the client machine,and i don't want to install ANY software in the client side. so that i try to copy the "oci.dll" to the same directory in the iis as the exe file.but client can't find it EITHER.maybe i should write the config file to tell the client where to find the "oci.dll",but i don't know how because i am a newbie to dotnet. who can tell me how to solve the problem? thank you very much!!!!!

Share this post


Link to post
Share on other sites
Advertisement
Someone else had a similar problem recently. Remember that when in debug mode, your exe file will be in the "/bin/" directory, and usually the other files will be one level up from there. If you're copying things to another spot, try putting the dll in a directory with a nested bin directory for the exe.

Also, you should probably use release mode when you're releasing your application.

Share this post


Link to post
Share on other sites
From memory you will need to install Oracle client on the machines. Oracle uses a system simular to the MS MDAC, but in it's own right. MS has drivers that Wrap the functions of the ORC DB Drivers.

You will also need to look at the firewalls on both systems, as oracle uses different and many ports. You will have to check the ORC Documentation as I can remember the ports

Also compileing in release mode will increase the performance of the application.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!