Friday, September 12, 2008

ASP.NET Three or more ways to connect Oracle Database

There are at least 3 ways to connect IIS to Oracle. there is the microsoft .net connector, OLEDB, and ODP.NET. The ODP.NET connector which is distributed by Oracle themselves and I strongly believes you will get more benefits out of Oracle database engine from the connector as they knows the best of what their database have. To use it requires that the oracle client software also be installed (This maybe changed with v12). You can download the client + ODP.NET here http://www.oracle.com/technology/software/tech/windows/odpnet/index.html.

You have the choice of version 9, 10 and 11. I haven't tried version 10 yet so I can't comment.

One common problem is then found that the web server can't find the Oracle dlls. You will need to grant read permission to various of the directories created during the Oracle install, or just grant rights for everything in the c:\oracle tree.

The DB server shouldn't need anything doing as long as it's already accessible from the network. The IIS server will need the oracle client to be configured so it can locate the DB server. There are various ways of doing this, including as a part of the install.

You will also need to modify your code to reference the oracle assemblies. This is 'add reference' if you're using VS.Net. You'll also need to add using clauses;

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

assuming C# use.

That should be a starting point.

Your Ad Here