共用方式為


DTSPackageInfoFlags Enumeration

Describes whether a package is a folder or package. It is used for setting a valid value in the Flags property.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Enumeration DTSPackageInfoFlags
public enum DTSPackageInfoFlags
public enum class DTSPackageInfoFlags
public enum DTSPackageInfoFlags
public enum DTSPackageInfoFlags

Members

Member name Description
Folder This is a folder.
Package This is a package.

範例

The following code example loads a sample package and displays some package properties, including the Flags property, which returns a value from this enumeration.

[C#]

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

namespace PackageInfoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //  The pkg variable points to a package
            //  installed with the SSIS samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";

            Application app = new Application();
            Package p1 = app.LoadPackage(pkg, null);
            p1.Description = "CalculatedColumns package";

            app.SaveToDtsServer(p1, null, @"File System\myp1Package", "YOURSERVER");
            PackageInfos pInfos = app.GetDtsServerPackageInfos(@"File System", "YOURSERVER");
            foreach (PackageInfo pinfo in pInfos)
            {
                Console.WriteLine("Package Information");
                Console.WriteLine("CreationDate:        {0}", pinfo.CreationDate);
                Console.WriteLine("Flags:               {0}", pinfo.Flags);
                Console.WriteLine("Folder:              {0}", pinfo.Folder);
                Console.WriteLine("Name:                {0}", pinfo.Name);
            }
         }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace PackageInfoTest
    Class Program
        Shared  Sub Main(ByVal args() As String)
            '  The pkg variable points to a package
            '  installed with the SSIS samples.
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx" 
 
            Dim app As Application =  New Application() 
            Dim p1 As Package =  app.LoadPackage(pkg,Nothing) 
            p1.Description = "CalculatedColumns package"
 
            app.SaveToDtsServer(p1, Nothing, "File System\myp1Package", "YOURSERVER")
            Dim pInfos As PackageInfos =  app.GetDtsServerPackageInfos("File System","YOURSERVER") 
            Dim pinfo As PackageInfo
            For Each pinfo In pInfos
                Console.WriteLine("Package Information")
                Console.WriteLine("CreationDate:        {0}", pinfo.CreationDate)
                Console.WriteLine("Flags:               {0}", pinfo.Flags)
                Console.WriteLine("Folder:              {0}", pinfo.Folder)
                Console.WriteLine("Name:                {0}", pinfo.Name)
            Next
        End Sub
    End Class
End Namespace

Sample Output:

Package Information

CreationDate: 3/24/2005 5:21:51 PM

Flags: Package

Folder: File System

Name: myp1Package

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

Microsoft.SqlServer.Dts.Runtime Namespace