OracleConnection.DataSource Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the Oracle server to which to connect.
public:
property System::String ^ DataSource { System::String ^ get(); };
public:
virtual property System::String ^ DataSource { System::String ^ get(); };
public string DataSource { get; }
[System.ComponentModel.Browsable(false)]
public override string DataSource { get; }
member this.DataSource : string
[<System.ComponentModel.Browsable(false)>]
member this.DataSource : string
Public ReadOnly Property DataSource As String
Public Overrides ReadOnly Property DataSource As String
Property Value
The name of the Oracle server to which to connect. The default value is an empty string ("").
- Attributes
Examples
The following example creates an OracleConnection and displays some of its read-only properties.
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
Applies to
See also
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.