Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

OracleConnection.DataSource Property

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

Gets the name of the Oracle server to which to connect.

[Visual Basic]
Public ReadOnly Property DataSource As String
public string DataSource {get;}
public: __property String* get_DataSource();
public function get DataSource() : String;

Property Value

The name of the Oracle server to which to connect. The default value is an empty string ("").


[Visual Basic, C#, C++] The following example creates an OracleConnection and displays some of its read-only properties.

[Visual Basic] 
Public Sub CreateOracleConnection()
    Dim myConnString As String = _
       "Data Source=Oracle8i;Integrated Security=yes"
    Dim myConnection As New OracleConnection(myConnString)
    MessageBox.Show("ServerVersion: " + myConnection.ServerVersion _
       + ControlChars.NewLine + "DataSource: " + myConnection.DataSource)
End Sub

public void CreateOracleConnection() 
   string myConnString = "Data Source=Oracle8i;Integrated Security=yes";
   OracleConnection myConnection = new OracleConnection(myConnString);
   MessageBox.Show("ServerVersion: " + myConnection.ServerVersion
      + "\nDataSource: " + myConnection.DataSource);

 void CreateOracleConnection() 
    String* myConnString = S"Data Source=Oracle8i;Integrated Security=yes";
    OracleConnection* myConnection = new OracleConnection(myConnString);
    MessageBox::Show(String::Format( S"ServerVersion: {0}\nDataSource: {1}",
       myConnection->ServerVersion, myConnection->DataSource ));

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.