| Oracle Data Provider for .NET Developer's Guide Release 9.2.0.2 Part Number A96160-01 |
|
This chapter introduces Oracle Data Provider for .NET (ODP.NET), an implementation of a data provider for the Oracle database.
This chapter contains these topics:
Oracle Data Provider for .NET (ODP.NET) is an implementation of a data provider for the Oracle database.
ODP.NET uses Oracle native APIs to offer fast and reliable access to Oracle data and features from any .NET application. ODP.NET also uses and inherits classes and interfaces available in the Microsoft .NET Framework Class Library.
For programmers using Oracle Provider for OLE DB, ADO (ActiveX Data Objects) provides an automation layer that exposes an easy programming model. ADO.NET provides a similar programming model, but without the automation layer, for better performance. More importantly, the ADO.NET model allows native providers such as ODP.NET to expose Oracle-specific features and datatypes.
Oracle.DataAccesss.dll assembly provides two namespaces:
Oracle.DataAccess.Client namespace contains ODP.NET classes.
Oracle.DataAccess.Types namespace contains the Oracle Data Provider for .NET Types (ODP.NET Types).
This namespace is the Oracle Data Provider for .NET (ODP.NET). Table 1-1 lists the client classes:
The Oracle.DataAccess.Types namespace provides classes and structures for Oracle native types that can be used with Oracle Data Provider for .NET. Table 1-2 lists these structures and classes:
The following is a very simple C# application that connects to an Oracle database and displays its version number before disconnecting.
using System; using Oracle.DataAccess.Client; class Example { OracleConnection con; void Connect() { con = new OracleConnection(); con.ConnectionString = "User Id=scott;Password=tiger;Data Source=oracle"; con.Open(); Console.WriteLine("Connected to Oracle"); } void Close() { con.Close(); con.Dispose(); } static void Main() { Example example = new Example(); example.Connect(); example.Close(); } }
|
|
![]() Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|