This documentation is archived and is not being maintained.

OracleConnection Constructor (String)

.NET Framework 1.1
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Initializes a new instance of the OracleConnection class with the specified connection string.

[Visual Basic]
Public Sub New( _
   ByVal connectionString As String _
public OracleConnection(
   string connectionString
public: OracleConnection(
   String* connectionString
public function OracleConnection(
   connectionString : String


The connection used to open the database.


When a new instance of OracleConnection is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the ConnectionString property.

Properties Initial Value
ConnectionString connectionString

You can change the value for these properties only by using the ConnectionString property.


[Visual Basic, C#, C++] The following example creates and opens an OracleConnection.

[Visual Basic] 
Public Sub CreateOracleConnection()
    Dim myConnString As String = "Data Source=Oracle8i;Integrated Security=yes"
    Dim myConnection As New OracleConnection(myConnString)
End Sub

public void CreateOracleConnection() 
   string myConnString = "Data Source=Oracle8i;Integrated Security=yes";
   OracleConnection myConnection = new OracleConnection(myConnString);

 void CreateOracleConnection() 
    String* myConnString = S"Data Source=Oracle8i;Integrated Security=yes";
    OracleConnection* myConnection = new OracleConnection(myConnString);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

OracleConnection Class | OracleConnection Members | System.Data.OracleClient Namespace | OracleConnection Constructor Overload List