OracleConnectionStringBuilder.DataSource プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
接続先の Oracle データ ソースの名前を取得または設定します。
public:
property System::String ^ DataSource { System::String ^ get(); void set(System::String ^ value); };
public string DataSource { get; set; }
member this.DataSource : string with get, set
Public Property DataSource As String
プロパティ値
DataSource プロパティの値。値が指定されていない場合は Empty。
例
次の例は、 クラスが OracleConnectionStringBuilder "Data Source" 接続文字列 キーのシノニムを既知のキーに変換することを示しています。
// You may need to set a reference to the System.Data.OracleClient
// assembly before you can run this sample.
using System.Data.OracleClient;
class Program
{
static void Main()
{
OracleConnectionStringBuilder builder =
new OracleConnectionStringBuilder(
"Server=OracleDemo;Integrated Security=True");
// Display the connection string, which should now
// contains the "Data Source" key, as opposed to the
// supplied "Server".
Console.WriteLine(builder.ConnectionString);
// Retrieve the DataSource property.
Console.WriteLine("DataSource = " + builder.DataSource);
Console.WriteLine("Press any key to continue.");
Console.ReadLine();
}
}
' You may need to set a reference to the System.Data.OracleClient
' assembly before running this example.
Imports System.Data.OracleClient
Module Module1
Sub Main()
Dim builder As _
New OracleConnectionStringBuilder( _
"Server=OracleDemo;Integrated Security=True")
' Display the connection string, which should now
' contains the "Data Source" key, as opposed to the
' supplied "Server".
Console.WriteLine(builder.ConnectionString)
' Retrieve the DataSource property.
Console.WriteLine("DataSource = " & builder.DataSource)
Console.WriteLine("Press any key to continue.")
Console.ReadLine()
End Sub
End Module
注釈
このプロパティは、接続文字列内の "データ ソース" キーと "サーバー" キーに対応します。 指定された接続文字列内で指定されているこれらの値に関係なく、 によってOracleConnectionStringBuilder作成された接続文字列は、既知の "データ ソース" キーを使用します。 このプロパティの設定を試行した際に、渡された値が null である場合、DataSource プロパティはリセットされます。 値が設定されておらず、開発者が プロパティの取得を試みる場合、戻り値は です Empty。