views:

1062

answers:

5

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 "

+1  A: 

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
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
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
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
A: 

In short, no.This is because the Oracle Data Provider for .Net needs to be installed on the client machine with the Oracle Universal Installer, though as Marc Gravell points out you can use Oracle's Instant Client (which is a handful of binaries and so easily deployed via ClickOnce).

Our applications work the same way as you describe yours - WinForms talking direct to an Oracle Database, and we're using DevArt's dotConnect for Oracle 3rd party libraries, and I think they're fantastic.

The 'killer' feature for me is that they support a direct connection to an Oracle Database - no Oracle Client Installation or 'TNSNames.ora' required whatsoever.

Andrew
I must insist that it *is* possible, i just got it to work!I downloaded ODAC from http://www.oracle.com/technology/software/tech/windows/odpnet/index1110710beta.html.Then i unzipped all the *.jar files and found oci.dll, Oracle.DataAccess.dll, oraociicus11.dll, OraOps11w.dll. When these dll's are copied into the same folder as my EXE, it just works, no oracle client installation or tnsnames.ora necessary.
Chris
I choose this as the best answer as all the methods other people give to get it working seem to only work some of the time on some versions of windows. Will they work on Windows 8?
Ian Ringrose
@Chris - I have to say well done. I want to believe it's possible, but I followed your instructions (and even tried copying ALL of the oracle DLL's) to an xcopy installation of our software and it failed on the first database call. This app works fine with Oracle installed rather than copied. :o/ (WinXP Pro if that matters)
Andrew
You can use the XCopy version of the ODAC rather than the Universal Installer version. That gives you what you need to distribute ODP.NET. I can't say that the XCopy install procedure meshes well with ClickOnce, but it's not true to say that you need to use the OUI. http://www.oracle.com/technology/software/tech/windows/odpnet/utilsoft.html
Darcy Casselman
@Darcy - I didn't know Oracle had produced an XCopy distribution (it looks new to 11g). You're correct that it doesn't mesh well with ClickOnce though, as it's got an 'install.bat' :o/
Andrew
I'm an avid Oracle fan, but they missed the point with .NET. The ODP.NET should have a thin client, similar to their Java version. Obviously it is a strategic choice and not an issue of funding or capability. They would like to funnel you away from MS and into Java, if possible. I recommend .NET folks try Devart dotConnect.
mrjoltcola
+4  A: 

I have seen this work, though I must say with a few limitations as of now.

I followed a number of different links I dug up explaining further what Marc Gravell has explained - including the DLLs in the VS.Net project as content with "Copy Always" as their deployment.

They are being distributed properly on ClickOnce deployment, and I have them down to roughly 28-30mb work of libraries (of no consequence in our environment, but may be an issue if you have WAN deployment to many machines, or across poor bandwidth).

  • I include Oracle.DataAccess.Client just like you would any other reference. And set Copy Local = True.

  • I include the following libraries in the root of my project (this is to avoid any issues with path, though I am sure you could more cleanly place them in a subfolder if you wished to fiddle around with path-ing a bit):

    msvcr71.dll - Microsoft runtime library. Not sure why it is needed but it is. oci.dll ociw32.dll orannzsbb11.dll oraocci11.dll oraociicus11.dll oraops11w.dll

    All the "o..." dll's are part of the instant client download available on oracle. I believe the version that I am using is 11.0.6, maybe 11.0.7 - sorry I am unable to find out at the moment. These files are included as Content and Copy Always

  • My connection string looks like this:

    *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;*

    Basically the Data Source looks like the TNSNAMES.ORA file, and then User ID and Password and security info make up the rest of the connection string.

Summary & Results:

What does this get me? It has allowed me to deploy via ClickOnce my WPF/C# application to XP workstations without fail.

Where it does fail so far is on Windows 2003, and Windows 7 workstations. It deploys, and then when it runs it never shows up. After debugging a little, I found it is choking on some of my CRUD fetch code... but as the application works well, and is still being deployed properly, I can only deduce that it is a compatibility with these OSes or 64-bit architecture.

With WiX or Xcopy there are ways to conditionally deploy client software based on OS, but in ClickOnce I have yet to find a way to accomplish this.

If anyone knows how to do that, I'm all ears.

Ian: Good luck. Let me know how it goes.

Marc: Lucky man. If the State wasn't broke I would beg for dotConnect. That using the Entity Framework would be deliciously easy to work with. No DAL at all, all nice and sexy OR/M done for ya. Congrats on scoring that tool.

-III

Trey
+1  A: 

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:

http://stackoverflow.com/questions/1193066/how-to-write-a-net-application-that-works-with-both-sqlserver-and-oracle-now-th/1209909#1209909

Christian Shay Oracle

Christian Shay
+1  A: 

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

ObiWanKenobi
Only Oracle will think that between 30 and 100 megabytes is a small footprint for a database client!
Ian Ringrose
@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