OracleConnection.DataSource プロパティ

定義

接続する Oracle サーバーの名前を取得します。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

プロパティ値

String

接続する Oracle サーバーの名前。The name of the Oracle server to which to connect. 既定値は空の文字列 ("") です。The default value is an empty string ("").

属性

を作成 OracleConnection し、その読み取り専用プロパティの一部を表示する例を次に示します。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

適用対象

こちらもご覧ください