7 The Oracle Data Provider : Provider Factories

Provider Factories
When you use the Common Programming Model, you do not need to specify the provider-specific namespace, because the Provider Factories generate instances of the specified data provider. However, if you want to use DataDirect Bulk Copy, you must include the DDTek.Data.Common namespace.
The following C# code snippet obtains an instance of the Oracle data provider:
DbProviderFactory factory = DbProviderFactories.GetFactory("DDTek.Oracle");
DbConnection Conn = factory.createConnection();
Conn.ConnectionString = "Host=Accounting1;Port=1521;Service Name=test;User ID=scott;Password=tiger";
 
try
{
    Conn.Open();
    Console.WriteLine("Connection successful!");
}
catch (Exception ex)
{
    // Connection failed
    Console.WriteLine(ex.Message);
}
// Close the connection
Conn.Close();