This documentation is archived and is not being maintained.

OracleConnection Constructor

.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.

Overload List

Initializes a new instance of the OracleConnection.

[Visual Basic] Public Sub New()
[C#] public OracleConnection();
[C++] public: OracleConnection();
[JScript] public function OracleConnection();

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

[Visual Basic] Public Sub New(String)
[C#] public OracleConnection(string);
[C++] public: OracleConnection(String*);
[JScript] public function OracleConnection(String);

Example

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

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the OracleConnection constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub CreateOracleConnection()
    Dim myConnString As String = "Data Source=Oracle8i;Integrated Security=yes"
    Dim myConnection As New OracleConnection(myConnString)
    myConnection.Open()
End Sub

[C#] 
public void CreateOracleConnection() 
{
   string myConnString = "Data Source=Oracle8i;Integrated Security=yes";
   OracleConnection myConnection = new OracleConnection(myConnString);
   myConnection.Open();
}

[C++] 
public:
 void CreateOracleConnection() 
 {
    String* myConnString = S"Data Source=Oracle8i;Integrated Security=yes";
    OracleConnection* myConnection = new OracleConnection(myConnString);
    myConnection->Open();
 }

[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.

See Also

OracleConnection Class | OracleConnection Members | System.Data.OracleClient Namespace

Show: