Oracle Database Interaction Using ODP.NET and ASP.NET: All Possible Ways To Get Connected
(Page 1 of 6 )
This article mainly concentrates on connecting to an Oracle database using ASP.NET in several possible ways, and finally focuses on ODP.NET and its advantages.
A downloadable file associated with this article is available
here.
The sample downloadable solution (zip) was entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition, together with Oracle 10g (version 10.2). But, I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.
What are OLEDB, ODBC, ADODB, .NET, ADO.NET, ODP.NET and hell?
Let us go back to history. Everyone knows how to connect to Oracle databases using old traditional ASP (using ADODB). ADODB is just a lightweight component on top of OLEDB. And OLEDB is said to be the beginning of Microsoft’s strategy for Universal Data Access (UDA). If we need to connect to desperate legacy systems (legacy databases such as Sybase and others), we should either work with the respective OLEDB provider of that database, or we can still use Microsoft ODBC (and face the penalty of slower performance). OLEDB can also work with ODBC internally. In summary, several of the complexities are hidden inside OLEDB, and we are provided with a very simple interface to work with databases called ADODB.
Is it not simply sufficient to work with ADODB and forget about ADO.NET? My answer to this question would be NOT AT ALL. Even though ADODB can meet all of our requirements, it is based on ActiveX technology and COM. The ActiveX components would not pass through a firewall (unless configured separately). Another issue of ADODB is that it is UNMANAGED. A final issue is that it does not have much interaction with XML at all. Of course, in the days when Microsoft started building ADODB technology, XML was not at all matured enough (and not even emerging).
Once XML emerged, matured and began to be accepted (or at least considered) by several companies, Microsoft also took part in developing XML and its family of technologies, together with other giant companies. Since XML is simply text (of course written in a structured manner), it is very light, easily transferable, platform independent and can even pass through networks (or even firewalls) very easily at high speed. No wonder Microsoft realized the power of XML and finally started to design a completely new platform based on XML technologies. And that new platform is nothing but the .NET platform. As ADO.NET is an integral part of the .NET framework itself, it is completely based on XML, which is fairly easy and quite manageable too.
ADO.NET internally contains few .NET data components (or .NET data providers) which can be used to connect to and access almost any database (again, an enhancement to the Universal Data Access strategy) in the world. Even though Microsoft designed its own .NET data providers, it has also opened its doors (specification) to the public and is encouraging other database companies to develop their own .NET data providers. One of them is Oracle’s ODP.NET, a .NET data provider that should be able to connect to and access Oracle databases with tight integrity.
Can’t we access Oracle without ODP.NET? YES, we still can. It is not compulsory for you to work with ODP.NET. We can still connect to and access Oracle using other, alternative methods like the OLEDB data provider for .NET, the ODBC data provider for .NET, and so on. In this article, I try to cover almost all of the methodologies for connecting to and accessing Oracle databases.
Next: Connecting to Oracle using the .NET Framework Data Provider for OLEDB >>
More ASP.NET Articles
More By Jagadish Chaterjee