开发者

ODP.net and Oracle 11g

开发者 https://www.devze.com 2023-02-14 12:19 出处:网络
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

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 开发者_Python百科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


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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消