Variable.Properties 屬性

定義

取得 DtsProperty 物件的集合。 這是唯讀的屬性。

public:
 property Microsoft::SqlServer::Dts::Runtime::DtsProperties ^ Properties { Microsoft::SqlServer::Dts::Runtime::DtsProperties ^ get(); };
public Microsoft.SqlServer.Dts.Runtime.DtsProperties Properties { get; }
member this.Properties : Microsoft.SqlServer.Dts.Runtime.DtsProperties
Public ReadOnly Property Properties As DtsProperties

屬性值

DtsProperties

DtsProperties 集合。

實作

範例

下列範例會建立封裝,並將變數加入至 Variables 集合。 然後,它會在 DtsProperties 集合中執行迴圈,並顯示集合中每個屬性的名稱。

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  

範例輸出:

變數中的屬性數目 = 12

CreationName

DataType

描述

EvaluateAsExpression

ID

名稱

命名空間

QualifiedName

RaiseChangedEvent

ReadOnly

SystemVariable

適用於