Task.GetConnectionID(Connections, String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
接続のIDを含む文字列を取得します。
public:
System::String ^ GetConnectionID(Microsoft::SqlServer::Dts::Runtime::Connections ^ connections, System::String ^ nameOrID);
public string GetConnectionID(Microsoft.SqlServer.Dts.Runtime.Connections connections, string nameOrID);
member this.GetConnectionID : Microsoft.SqlServer.Dts.Runtime.Connections * string -> string
Public Function GetConnectionID (connections As Connections, nameOrID As String) As String
パラメーター
- connections
- Connections
レビューするべき Connections コレクション。
- nameOrID
- String
戻る接続の名前。
返品
接続のIDを含む文字列です。
例
以下のコード例は、 GetConnectionID メソッドを使ってタスクのカスタム myConnection プロパティで接続の名前とIDを取得し設定するタスクの例を示しています。
public string myConnection
{
get
{return GetConnectionName(m_connections, m_ MyConnectionName);
}
set
{m_MyConnectionName = GetConnectionID(m_connections, value);}
}
Public Property myConnection() As String
Get
Return GetConnectionName(m_connections, m_ MyConnectionName)
End Get
Set (ByVal Value As String)
m_MyConnectionName = GetConnectionID(m_connections, value)
End Set
End Property
注釈
この関数はカスタムタスクを書く際に、接続IDと接続名の変換をしたい場合に役立ちます。