6

We have a sqlserver (WinForms) application that is deployed with ClickOnce that talks directly to the database. If we are forced to port it to oracle, can ODP.NET be used with ClickOnce.

(The users may not have admin rights on their PCs)

Background

This data import application is used by a handful of users at each customer’s site it uses intergraded logon to connect to SQL Server. Most users access the system var an Asp.net application, or a WinForms (clickOnce) application that talks to a web service.

see also "How to write a .Net application that works with both SqlServer and Oracle "

Community
  • 1
  • 1
Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317
  • I've updated my answer. I've also included instruction for Smart, Thing, and Fat client apps. The principle to the answer remains the same - if you want to distribute your app via ClickOnce to end users without the Oracle Client or ODP.Net installed, they must be embedded in your app and the instructions are the same for 11.2 R4. Let me know if you need further details and I'll provide them if I can. – one.beat.consumer Jan 25 '12 at 07:37
  • Ian - I think the ODP.Net + ClickOnce has been pretty thoroughly answered. If you need more info `MS-SQL + Oracle`, you'll probably want a separate Question – one.beat.consumer Feb 01 '12 at 01:24

4 Answers4

7

EDIT: I have revised this answer for modernization. Also, to clarify, ClickOnce is merely an application deployment tool, how to use Oracle Client and ODP.Net with your application is still determined by architecture. Here's a summary of the most common scenarios:

Smart Client Apps (ex. Client App + Web Service)

Your ClickOnce-deployed client application is installed on users' machines, but speaks to some sort of service to work with data. In this scenario, your client application does not need to distribute an Oracle Client or ODP.Net.

The Oracle Client and ODP.Net package should be installed via Oracle's normal instructions on the machine hosting the back-end service, and referenced from that project/application as any other library would be used/distributed.

Fat Client "Thin Deployment" Apps (ex. "fat client" on Citrix)

Your ClickOnce-deployed client application is "fat" in that it includes its own data layer, and therefore must be able to connect to Oracle via a locally installed client, and able to reference the ODP.Net libraries.

In this scenario, the Oracle Client and ODP.Net packages should be installed on the hosting machine (ex. Citrix box) using Oracle's standard instructions, and your application should reference the appropriate libraries installed on its hosting computer.

Fat Client "Fat Deployment" Apps (ex. fat-client on users' machines)

In this scenario, your application is a typical "fat client" in that it has its own data layer and needs to be able to communicate with the Oracle Client and ODP.Net libraries.

The particular scenario we're discussing here is how to distribute Oracle Client and ODP.Net within your application (ex. when your users do not have these products installed on their machines). Below are instructions:

  1. Download the Oracle Data Access Components package.

    (A) the current version is ODAC 11.2 Release 4 (11.2.0.3) and includes support for Microsoft Entity Framework 4.

    (B) You will need the 32-bit version of ODP.Net installed as Visual Studio is a 32-bit application. You can then compile to a target processor and bit version when you deploy.

  2. In the ODAC package are the Oracle Instant Client and ODP.Net libraries. You need to copy the instant client libraries to your application and set them to "Copy Always"

  3. Reference Oracle.DataAccess.Client like you would any other lib and set Copy Local = True.

  4. Your connection string should look much like a normal entry in a TNSNAMES.ORA file:

     Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED) (SID = oracle_world_here)));User Id=schema_here;Password=password_here;Persist Security Info=TRUE;
    

Notes

A. There are two main versions of the instant client - the full version (approx. 115mb) which includes multiple language support, and the Lite version (approx. 28mb) with support for only English.

B. IMPORTANT Ensure the libraries deployed are all from the same version of the client - meaning if you deploy 32-bit ODP.Net you have to deploy 32-bit instant client libs. If you use 11.2 instant client, you cannot use 11.0 ODP.Net, etc. -- silly but lots of people overlook this; use good source control.

C. My experience, the following libraries were placed in the root of my project (to avoid any issues with permissions or %PATH%)

oci.dll, ociw32.dll, orannzsbb11.dll, oraocci11.dll, oraociicus11.dll, oraops11w.dll


Summary & Results:

You can now use ClickOnce deployments for all Windows Client applications - fat, thing, or smart.

one.beat.consumer
  • 9,414
  • 11
  • 55
  • 98
3

Instant Client supports xcopy deployment, so the same approach (including them in your ClickOnce deployment) should make it OK to deploy.

However! In many cases it may be more appropriate (with ClickOnce) to use a "smart client" approach, i.e. do the data access via an app-server via web-services. Then you don't need any DAL components in the client.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • has anyone seen this working, including coping with connection stings etc. We can't have each user having to edit all the oracle config files on their PCs – Ian Ringrose Jul 28 '09 at 10:34
  • We do use a "smart client" approach for most of our apps, however when we wrote the data inport app, web services / .net remoting was not fast enough. We were also on tight time scales. – Ian Ringrose Jul 28 '09 at 10:39
  • Re performance; I know what you mean. I have a few SQL-Server apps that go direct for the same reasons - when necessary ;-p – Marc Gravell Jul 28 '09 at 10:52
  • Good point. When I first started using Oracle and ODP.Net I was also learning WPF and the company was weary of web services. In hindsight, I would suggest to others now to look into services first, and look to the instant client as a secondary option. – one.beat.consumer Nov 30 '11 at 08:08
1

It is possible, see http://ora-00001.blogspot.com/2010/01/odpnet-minimal-non-intrusive-install.html

ObiWanKenobi
  • 14,526
  • 11
  • 45
  • 51
  • Only Oracle will think that between 30 and 100 megabytes is a small footprint for a database client! – Ian Ringrose Sep 01 '10 at 16:30
  • @Ian: That is true. But at least xcopy deployment of 30-100 megabytes is a big improvement over the 600-700 megabytes required for the full Oracle client software which must be installed via the Java-based Oracle Universal Installer... :-) – ObiWanKenobi Sep 02 '10 at 06:34
0

XCOPY deployment is the closest you are going to get to a click once deployment with ODP.NET.

I just replied to another one of your posts here will a lot of detail about XCOPY deployment.

Please have a look:

How to write a .Net application that works with both SqlServer and Oracle (now that System.Data.OracleClient is deprecated)

Christian Shay Oracle

EDIT: Oracle has announced that sometime in 2011 they will release a fully managed version of the ODP.NET provider (aka thin client). When that happens there will be no dependency by ODP.NET on any other files and ClickOnce deployment will be simpler.

Feel free to provide your feedback on this and other future features at our feature request website: http://apex.oracle.com/pls/apex/f?p=18357:46

Community
  • 1
  • 1
Christian Shay
  • 2,570
  • 14
  • 24