DtsContainer.Variables 屬性

定義

傳回集合,其中包含與這個容器相關聯的變數。 這是唯讀的屬性。

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

屬性值

Variables

Variables 集合。

範例

下列範例會建立封裝,並將變數加入 myVar 至變數集合。 Package Variables 透過繼承的來使用集合 DtsContainer

static void Main(string[] args)  
        {  
            Package p = new Package();  
            //Add a variable, ,myvar, to the package variables  
            // collection with a value of 5, in the myNamespace  
            // namespace  
            Variable var = p.Variables.Add("myVar", false, "myNamespace", 5);  
            //  
            // rest of code here...  
            //  
        }  
Shared  Sub Main(ByVal args() As String)  
            Dim p As Package =  New Package()   
            'Add a variable, ,myvar, to the package variables  
            ' collection with a value of 5, in the myNamespace  
            ' namespace  
            Dim var As Variable =  p.Variables.Add("myVar",False,"myNamespace",5)   
            '  
            ' rest of code here...  
            '  
End Sub  

適用於