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.

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

Remarks

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.

Example

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

Requirements

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

Show: