65.9K
CodeProject is changing. Read more.
Home

Oracle Data Access Block for .NET

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.50/5 (17 votes)

May 8, 2006

viewsIcon

74299

downloadIcon

3014

This is an Oracle Data Layer class for connecting to Oracle Database from a .net application based on Oracle Data Provider.NET

Introduction

This is an Oracle Data Layer class for connecting to Oracle Database from a .NET application

Oracle Data Provider for .NET (ODP.NET) is an implementation of a data providerfor the Oracle database.ODP.NET uses Oracle native APIs to offer fast and reliable access to Oracle data andfeatures from any .NET application. ODP.NET also uses and inherits classes andinterfaces available in the Microsoft .NET Framework Class Library.based on Oracle Data Provider.NET.

This C# class file contains two classes OracleDataAcess and OracleDataAccessParameterCache. We can easily manage the application Business layer by using this class. Here I give the sample code of the implementation of DataLayer in the Business Layer.

OracleParameter[] oraParam = new OracleParameter[2];


oraParam[0] = new OracleParameter("CustomerID", "100");
oraParam[1] = new OracleParameter("ResultCursor", OracleDbType.RefCursor);

oraParam[1].Direction = ParameterDirection.Output;

DataSet ObjDS =  OracleDataAccess.ExecuteDataset(connectionString, 
                 CommandType.StoredProcedure, 
                 "Pr_GetCustomerDetails",oraParam );