2 Using the Data Providers : Connecting with a Data Provider

Connecting with a Data Provider
The DataDirect Connect for ADO.NET data providers attach a data provider-specific prefix to the public .NET objects. For example, the Connection object for the Oracle data provider is OracleConnection.
You can connect to a database through the Connection object, using the method Connection.Open().
C# Example
DbProviderFactory Factory = DbProviderFactories.GetFactory("DDTek.Oracle");
DbConnection Conn = Factory.CreateConnection();
Conn.ConnectionString = "Host=localhost;Port=1521;User ID=scott;Password=tiger;
                          Service Name=ORCL";
Conn.Open();
Visual Basic Example
Dim df As DbProviderFactoryDf = DbProvideries.GetFactory("DDTek.Oracle");
Dim conn As DbConnection = df.CreateConnection()
conn.ConnectionString = csb.ConnectionString
The following code fragments use the OracleConnection object to connect to Oracle while passing the user name and password.
C# Example
OracleConnection ocon = new OracleConnection("Host=server1;Port=1521
                          User ID=scott;Password=tiger;Service Name=ORCL");
ocon.Open();
Visual Basic Example
Dim Conn As New OracleConnection Conn = new OracleConnection("Host=server1;
                                     Port=1521;User ID=scott;Password=tiger;Service Name=ORCL")
Conn.Open()