Solved

how to no-touch deploy the db access winform?

Posted on 2004-10-10
6
523 Views
Last Modified: 2012-05-05
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!!!!!  
 
0
Comment
Question by:zbcong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 500 total points
ID: 12269453
The oracle client is a COM component, and System.Data.OracleClient is only an interop wrapper. Therefore, a XCOPY installation dows not work in this case. There are, however, different solutions to solve this:

- Make a service on the server that accepts remoting calls and acts as proxy for the oracle client. This would prevent the client from needing and oracle stuff, and it wouldn't even need an oracle DB connection.

- Add some code that permanently or temporarily installs the needed COM components when the application is run (basically, do what REGSVR32 does) on the fly without user interaction. This would prevent you from using an installer or anything.
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 12512514
I made two suggestions which would solve the issue. No feedback recevied...
0
 

Author Comment

by:zbcong
ID: 12520620
sorry AvonWyss, i forgot to answer.

your first suggestions can solve my problem well. to your second suggestion, i also feel some interest, could your give me a little more detailed instruction? such as: if the app register the "com" component on the fly, the app must copy the  com to local machine, how?

thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question