Metoda Task.GetConnectionID
Pobiera ciąg zawierający identyfikator połączenia.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public Function GetConnectionID ( _
connections As Connections, _
nameOrID As String _
) As String
'Użycie
Dim instance As Task
Dim connections As Connections
Dim nameOrID As String
Dim returnValue As String
returnValue = instance.GetConnectionID(connections, _
nameOrID)
public string GetConnectionID(
Connections connections,
string nameOrID
)
public:
String^ GetConnectionID(
Connections^ connections,
String^ nameOrID
)
member GetConnectionID :
connections:Connections *
nameOrID:string -> string
public function GetConnectionID(
connections : Connections,
nameOrID : String
) : String
Parametry
- connections
Typ: Microsoft.SqlServer.Dts.Runtime.Connections
Connections kolekcja do przeglądu.
- nameOrID
Typ: System.String
Nazwa połączenia, aby powrócić.
Wartość zwracana
Typ: System.String
A ciąg zawierający identyfikator połączenia.
Uwagi
Ta funkcja jest przydatna podczas są pisania niestandardowych zadań i chcesz przekonwertować identyfikator połączenia między nazwa połączenia.
Przykłady
Poniższy przykład kodu pokazuje przykład zadania, który używa GetConnectionID metoda get i zestaw nazwy i Identyfikatora połączenia w zadania użytkownika niestandardowego myConnection właściwość.
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