OracleConnection Constructor (String)

 

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

Namespace:   System.Data.OracleClient
Assembly:  System.Data.OracleClient (in System.Data.OracleClient.dll)

Public Sub New (
	connectionString As String
)

Parameters

connectionString
Type: System.String

The connection used to open the database.

The following example creates and opens an OracleConnection.

Public Sub CreateOracleConnection()
    Dim connectionString As String = _
       "Data Source=Oracle8i;Integrated Security=yes"

    Using connection As New OracleConnection(connectionString)
        connection.Open()
        Console.WriteLine("ServerVersion: " + connection.ServerVersion _
           + ControlChars.NewLine + "DataSource: " + connection.DataSource)
    End Using
End Sub

.NET Framework
Available since 1.1
Return to top
Show: