1
votes

I am developing my own ASP.net 4.0 website. I installed Oracle 11g on my server at home, and Oracle Client 11g on my laptop. I am using SQL Developer to view Database. Everything is going great and I can view data.

however, I am trying now to make my code communicate properly with my database using Visual Studio 2010. I want to use ODP.net to connect to database. I don't know how and where to start! Please guide me with instructions or a good book that explain the relationship between Oracle 11g and ASP.net 4.0.

Also, Is it good to use ODP.net or other tools?

Thanks,

Sami

3
Do you know how to setup a System.Data.DbConnection, System.Data.DbCommand, DbDataReader and DataAdapter? For ODP.NET there is not much difference....rene

3 Answers

1
votes

ODP.Net is the way to go as Microsoft has declared the .NET's Oracle implementation deprecated (see here: System.Data.OracleClient Namespace).

ODP.Net is a just another standard ADO.NET provider. Here is a tutorial here: Using Oracle Data Provider for .NET

0
votes

Programatically, you will want to use the Oracle ODP (Oracle Data Provider) component (with the Oracle.DataAccess namespace). The docs for ODP are here: http://docs.oracle.com/cd/E11882_01/win.112/e23174/toc.htm

In terms of installation and deployment, you will need to install ODAC (Oracle Data Access Components). This package includes all necessary dependencies (Oracle Instant Client, dependent unmanaged DLLs, etc) needed by ODP to connect to the DB. http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html

0
votes

I recommend you to use a framework, like Enterprise Library, for instance.

Enterprise Library makes it a lot easier for you to work with Database connections and commands, not only easier, but reusable. You can change your Database and change only the Provider you use in the configuration. No need to change the code. It is able to do that by using abstract classes instead of the concrete ones.

You can see a simple tutorial that shows you how to do that here.