Microsoft OracleClient to ODP.NET Application Migration: Factory Class Code Migration


If your application uses ADO.NET provider-independent code through factory classes, then migrating from Microsoft OracleClient to ODP.NET is quite simple. Modify the following line of code in your ADO.NET application.

C#:

Find: DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OracleClient");
Replace with: DbProviderFactory factory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");

Visual Basic:

Find: Dim factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OracleClient")
Replace with: Dim factory As DbProviderFactory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client")

You may also need to modify the connection string if you use Microsoft OracleClient attributes not available in ODP.NET.

Next step: ODP.NET Deployment

 Microsoft OracleClient to ODP.NET Application Migration: Introduction
 
 Main Page