语言

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

属性值

包含DtsPropertiesDtsProperty与容器相关的对象的集合。

示例

实现该IDTSPropertiesProvider接口的类之一是 。Package 以下代码示例展示了该类如何 Package 返回 DtsProperties 方法中的 Properties 集合。 代码示例随后遍历属性,显示多个值。

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  

示例输出:

名称 CertificateContext,类型 Int64,package path\Package.CertificateContext

命名 CertificateObject, 类型对象, package path\Package.CertificateObject

命名 CheckpointFileName,类型字符串,package path\package.CheckpointFileName

命名 CheckpointUsage, Type Object, Package path\Package.CheckpointUsage

Name CheckSignatureOnLoad,类型布林,package path\package.CheckSignatureOnLoad

命名配置,类型对象,package path\package.configurations

命名连接,类型对象,package path\package.connections

命名 CreationDate,类型 DateTime,package path\Package.CreationDate

命名 CreationName,类型字符串,package path\package.CreationName

命名 CreatorComputerName,类型字符串,package path\package.CreatorComputerName

命名 CreatorName,类型字符串,package path\package.CreatorName

适用于