dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleConnectionStringBuilder Class
Members Example

In This Topic
    OracleConnectionStringBuilder Class
    In This Topic
    Generates automatically connection strings used to connect to Oracle.
    Syntax
    Remarks
    The OracleConnectionStringBuilder allows you to construct a connection string by assigning values to corresponding properties. After you have initialized all connection properties you need, use System.Data.Common.DbConnectionStringBuilder.ConnectionString property or ToString method to obtain the connection string built.
    Example
    This sample shows how to construct a connection string and pass it to OracleConnection object.
    public void UseConnectionStringBuilder()
    {
            OracleConnectionStringBuilder myCSB = new OracleConnectionStringBuilder();
            oraCSB.Direct = true;
            oraCSB.Server = "192.168.0.1";
            oraCSB.Port = 1521;
            oraCSB.Sid = "OracleSid";
            oraCSB.UserId = "scott";
            oraCSB.Password = "tiger";
            oraCSB.MaxPoolSize = 150;
            oraCSB.ConnectionTimeout = 30;
            OracleConnection myConnection = new OracleConnection(myCSB.ConnectionString);
            myConnection.Open();
            Console.WriteLine(myConnection.ServerVersion);
            myConnection.Close();
    }
    Public Sub UseConnectionStringBuilder()
            Dim myCSB As OracleConnectionStringBuilder = New OracleConnectionStringBuilder
            oraCSB.Direct = true
            oraCSB.Server = "192.168.0.1"
            oraCSB.Port = 1521
            oraCSB.Sid = "OracleSid"
            oraCSB.UserId = "scott"
            oraCSB.Password = "tiger"
            oraCSB.MaxPoolSize = 150
            oraCSB.ConnectionTimeout = 30
            Dim myConnection As OracleConnection = New OracleConnection(myCSB.ConnectionString)
                    myConnection.Open()
            Console.WriteLine(myConnection.ServerVersion)
            myConnection.Close()
    End Sub
    Inheritance Hierarchy

    System.Object
       System.Data.Common.DbConnectionStringBuilder
          Devart.Common.DbConnectionStringBuilder
             Devart.Data.Oracle.OracleConnectionStringBuilder

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also