Właściwość Variable.Properties
Zwraca kolekcja DtsProperty obiektów.Ta właściwość jest tylko do odczytu.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public ReadOnly Property Properties As DtsProperties
Get
'Użycie
Dim instance As Variable
Dim value As DtsProperties
value = instance.Properties
public DtsProperties Properties { get; }
public:
virtual property DtsProperties^ Properties {
DtsProperties^ get () sealed;
}
abstract Properties : DtsProperties
override Properties : DtsProperties
final function get Properties () : DtsProperties
Wartość właściwości
Typ: Microsoft.SqlServer.Dts.Runtime.DtsProperties
A DtsProperties kolekcja.
Implementacje
Przykłady
Poniższy przykład tworzy pakiet i dodaje zmienną Variables kolekcja.Następnie pętli przegląda DtsProperties kolekcja i wyświetla nazwę każdej właściwość kolekcja.
static void Main(string[] args)
{
Package p = new Package();
Variable v = p.Variables.Add("x", false, "", 1);
int vCount = v.Properties.Count;
Console.WriteLine("Number of properties in a variable = {0}", vCount);
DtsProperties vProps = v.Properties;
foreach (DtsProperty vProp in vProps)
Console.WriteLine(vProp.Name);
}
Shared Sub Main(ByVal args() As String)
Dim p As Package = New Package()
Dim v As Variable = p.Variables.Add("x",False,"",1)
Dim vCount As Integer = v.Properties.Count
Console.WriteLine("Number of properties in a variable = {0}", vCount)
Dim vProps As DtsProperties = v.Properties
Dim vProp As DtsProperty
For Each vProp In vProps
Console.WriteLine(vProp.Name)
Next
End Sub
Przykładowe dane wyjściowe:
Liczba właściwości w zmiennej = 12
CreationName
DataType
Opis
EvaluateAsExpression
Identyfikator
Nazwa
Przestrzeń nazw
QualifiedName
RaiseChangedEvent
Tylko do odczytu
SystemVariable
Wartość