Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative Oracle drivers for .net

I have to develop a tool in C# that retrieves some data from an Oracle DB. Since our IT support is having some trouble with installing the Oracle client, I want to be able to connect to the database without the client installed. The idea is to just install (and maybe register) an additional library together with the app.

Which alternatives to the Oracle client exist, and what are their pros and cons?

This is for a small application (1 form, 2 or 3 queries, the result displayed in a DataGrid, probably no more than 10-20 data sets), but I am also interested in scalability issues, since we may also move away from the Oracle client with bigger future projects.

Of course a freeware solution would be nice, but we are not limited to that.

like image 395
Treb Avatar asked Jan 30 '09 15:01

Treb


3 Answers

Your task can be achieved without the need of any third party software:

  1. Install Oracle Data Access Components 11g in your development box. ODAC 11g is backwards compatible with 9i and 10g
  2. Add a reference to the ODAC library in your .NET projects (Oracle.DataAccess.dll).
  3. Allow your application to connect without the use of TNSNAMES.ORA. To do so, you have to include the connect descriptor in the connection string:

    "user id=scott;password=tiger;data source=" + "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" + "(HOST=sales-server)(PORT=1521))(CONNECT_DATA="+ "(SERVICE_NAME=sales.us.acme.com)))"

Since you are including the connect descriptor in the connection string, the thin client is not required in the targeted computers.

Happy deployment.

like image 197
Igor Zelaya Avatar answered Nov 14 '22 06:11

Igor Zelaya


There are a couple different flavors of the Oracle ODP.Net driver. Which version are you trying to use?

It sounds like you want the Oracle 11g ODAC 11.1.0.6.21 with Xcopy Deployment, which allows you to deploy the Oracle Instant Client and the ODP.Net driver just by copying a few DLLs over and registering them. That doesn't require a full-blown Oracle client installation.

like image 8
Justin Cave Avatar answered Nov 14 '22 05:11

Justin Cave


Oracle currently has a version of ODP.NET that is fully managed, allowing developers to connect to Oracle databases while referencing only a single DLL. There's more information here.

Current releases can be found here.

like image 3
Peder Rice Avatar answered Nov 14 '22 05:11

Peder Rice