Condividi tramite


PackageInfo.Flags Property

Gets an enumeration that describes whether the package is a folder or package. This property is read-only.

Spazio dei nomi: Microsoft.SqlServer.Dts.Runtime
Assembly : Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property Flags As DTSPackageInfoFlags
public DTSPackageInfoFlags Flags { get; }
public:
property DTSPackageInfoFlags Flags {
    DTSPackageInfoFlags get ();
}
/** @property */
public DTSPackageInfoFlags get_Flags ()
public function get Flags () : DTSPackageInfoFlags

Valore proprietà

A value from the DTSPackageInfoFlags enumeration.

Esempio

The following code example loads a sample package, saves the package to the service, and then retrieves the packages and iterates through the properties.

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("Description:         {0}", pinfo.Description);
                Console.WriteLine("Flags:               {0}", pinfo.Flags);
                Console.WriteLine("Folder:              {0}", pinfo.Folder);
                Console.WriteLine("Name:                {0}", pinfo.Name);
                Console.WriteLine("PackageDataSize:     {0}", pinfo.PackageDataSize);
                Console.WriteLine("PackageGuid:         {0}", pinfo.PackageGuid);
                Console.WriteLine("VersionBuild:        {0}", pinfo.VersionBuild);
                Console.WriteLine("VersionComments      {0}", pinfo.VersionComments);
                Console.WriteLine("VersionGUID          {0}", pinfo.VersionGUID);
                Console.WriteLine("VersionMajor         {0}", pinfo.VersionMajor);
                Console.WriteLine("VersionMinor         {0}", pinfo.VersionMinor);
                Console.WriteLine();
            }
         }
    }
}
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("Description:         {0}", pinfo.Description)
                Console.WriteLine("Flags:               {0}", pinfo.Flags)
                Console.WriteLine("Folder:              {0}", pinfo.Folder)
                Console.WriteLine("Name:                {0}", pinfo.Name)
                Console.WriteLine("PackageDataSize:     {0}", pinfo.PackageDataSize)
                Console.WriteLine("PackageGuid:         {0}", pinfo.PackageGuid)
                Console.WriteLine("VersionBuild:        {0}", pinfo.VersionBuild)
                Console.WriteLine("VersionComments      {0}", pinfo.VersionComments)
                Console.WriteLine("VersionGUID          {0}", pinfo.VersionGUID)
                Console.WriteLine("VersionMajor         {0}", pinfo.VersionMajor)
                Console.WriteLine("VersionMinor         {0}", pinfo.VersionMinor)
                Console.WriteLine()
            Next
        End Sub
    End Class
End Namespace

Sample Output:

Package Information

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

Description:

Flags: Package

Folder: File System

Name: myp1Package

PackageDataSize: 0

PackageGuid:

VersionBuild: 0

VersionComments

VersionGUID

VersionMajor 0

VersionMinor 0

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

PackageInfo Class
PackageInfo Members
Microsoft.SqlServer.Dts.Runtime Namespace