IDTSPropertiesProvider.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 集合,该集合包含与此容器关联的 DtsProperty 对象。

示例

实现 IDTSPropertiesProvider 接口的类之一是 Package 类。 下面的代码示例演示类如何PackageProperties方法返回DtsProperties集合。 然后,代码示例循环访问属性,并显示多个值。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package p1 = new Package();  

           // Retrieve the information from the Properties collection.  
           // Each item in the collection represents a property on the  
           // object. This example reviews the properties of the   
           // Package object.  

            DtsProperties props = p1.Properties;  
            String name;  
            String path;  
            TypeCode propType;  

            foreach (DtsProperty prop in props)  
            {  
                propType = prop.Type;  
                name = prop.Name;  
                path = prop.GetPackagePath(p1);  
                Console.WriteLine("Name {0}, Type {1}, Package path{2}", name, propType, path);  
            }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim p1 As Package =  New Package()   

           ' Retrieve the information from the Properties collection.  
           ' Each item in the collection represents a property on the  
           ' object. This example reviews the properties of the   
           ' Package object.  

            Dim props As DtsProperties =  p1.Properties   
            Dim name As String  
            Dim path As String  
            Dim propType As TypeCode  

            Dim prop As DtsProperty  
            For Each prop In props  
                propType = prop.Type  
                name = prop.Name  
                path = prop.GetPackagePath(p1)  
                Console.WriteLine("Name {0}, Type {1}, Package path{2}", name, propType, path)  
            Next  
        End Sub  
    End Class  
End Namespace  

示例输出:

Name CertificateContext、Type Int64、Package path\Package.CertificateContext

Name CertificateObject、Type Object、Package path\Package.CertificateObject

Name CheckpointFileName,类型字符串,包路径\Package.CheckpointFileName

名称 CheckpointUsage、类型对象、包路径\Package.CheckpointUsage

Name CheckSignatureOnLoad, Type Boolean, Package path\Package.CheckSignatureOnLoad

名称配置、类型对象、包路径\Package.Configurations

名称连接,类型对象,包路径\Package.Connections

Name CreationDate、Type DateTime、Package path\Package.CreationDate

名称 CreationName、类型字符串、包路径\Package.CreationName

Name CreatorComputerName,类型字符串,包路径\Package.CreatorComputerName

Name CreatorName、Type String、Package path\Package.CreatorName

适用于