OracleConnection OracleConnection OracleConnection OracleConnection Constructors

Definizione

Overload

OracleConnection() OracleConnection() OracleConnection()

Inizializza una nuova istanza dell'oggetto OracleConnection.Initializes a new instance of the OracleConnection.

OracleConnection(String) OracleConnection(String) OracleConnection(String) OracleConnection(String)

Inizializza una nuova istanza della classe OracleConnection con la stringa di connessione specificata.Initializes a new instance of the OracleConnection class with the specified connection string.

OracleConnection() OracleConnection() OracleConnection()

Inizializza una nuova istanza dell'oggetto OracleConnection.Initializes a new instance of the OracleConnection.

public:
 OracleConnection();
public OracleConnection ();
Public Sub New ()

Esempi

Nell'esempio seguente crea e apre un OracleConnection.The following example creates and opens an OracleConnection.

public void CreateOracleConnection()
{
    string connectionString = "Data Source=Oracle8i;Integrated Security=yes";
    using (OracleConnection connection = new OracleConnection(connectionString))
    {
        connection.Open();
        Console.WriteLine("ServerVersion: " + connection.ServerVersion
            + "\nDataSource: " + connection.DataSource);
    }
}
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

OracleConnection(String) OracleConnection(String) OracleConnection(String) OracleConnection(String)

Inizializza una nuova istanza della classe OracleConnection con la stringa di connessione specificata.Initializes a new instance of the OracleConnection class with the specified connection string.

public:
 OracleConnection(System::String ^ connectionString);
public OracleConnection (string connectionString);
new System.Data.OracleClient.OracleConnection : string -> System.Data.OracleClient.OracleConnection
Public Sub New (connectionString As String)

Parametri

connectionString
String String String String

Connessione utilizzata per aprire il database.The connection used to open the database.

Esempi

Nell'esempio seguente crea e apre un OracleConnection.The following example creates and opens an OracleConnection.

public void CreateOracleConnection()
{
    string connectionString = "Data Source=Oracle8i;Integrated Security=yes";
    using (OracleConnection connection = new OracleConnection(connectionString))
    {
        connection.Open();
        Console.WriteLine("ServerVersion: " + connection.ServerVersion
            + "\nDataSource: " + connection.DataSource);
    }
}
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

Si applica a