Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Technical Reference
Package Class
Package Properties
 ProtectionLevel Property
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
Package.ProtectionLevel Property

Gets or sets the level of protection on the package.

Namespace: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
VisualBasicDeclaration
Public Property ProtectionLevel As DTSProtectionLevel
CSharp
public DTSProtectionLevel ProtectionLevel { get; set; }
ManagedCPlusPlus
public:
property DTSProtectionLevel ProtectionLevel {
    DTSProtectionLevel get ();
    void set (DTSProtectionLevel value);
}
JSharp
/** @property */
public DTSProtectionLevel get_ProtectionLevel ()

/** @property */
public void set_ProtectionLevel (DTSProtectionLevel value)
JScript
public function get ProtectionLevel () : DTSProtectionLevel

public function set ProtectionLevel (value : DTSProtectionLevel)

Property Value

A value from the DTSProtectionLevel enumeration.

For more information on setting package protection levels, see Setting the Protection Level of Packages.


The following example loads a package, and then retrieves several package properties, including the ProtectionLevel assigned to the package.

CSharp
Class PackageTest
    {
        static void Main(string[] args)
        {
            // The variable pkg points to the location of the
            // ExecuteProcess package sample
            // installed with the samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
            
            Application app = new Application();
            Package p = app.LoadPackage(pkg, null);
    
            // Once the package is loaded, this sample can
           // query on several properties
            long cc = p.CertificateContext;
            string cfn = p.CheckpointFileName;
            DTSProtectionLevel pl = p.ProtectionLevel;
            DTSPackageType dpt = p.PackageType;

            Console.WriteLine("CertificateContext = " + cc);
            Console.WriteLine("CheckpointFileName = " + cfn);
            Console.WriteLine("ProtectionLevel = " + pl);
            Console.WriteLine("PackageType = " + dpt);
        }
    }
VisualBasic
Class PackageTest
    {
        Shared  Sub Main(ByVal args() As String)
            ' The variable pkg points to the location of the
            ' ExecuteProcess package sample
            ' installed with the samples.
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx" 
 
            Dim app As Application =  New Application() 
            Dim p As Package =  app.LoadPackage(pkg,Nothing) 
 
            ' Once the package is loaded, this sample can
           ' query on several properties
            Dim cc As Long =  p.CertificateContext 
            Dim cfn As String =  p.CheckpointFileName 
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel 
            Dim dpt As DTSPackageType =  p.PackageType 
 
            Console.WriteLine("CertificateContext = " + cc)
            Console.WriteLine("CheckpointFileName = " + cfn)
            Console.WriteLine("ProtectionLevel = " + pl)
            Console.WriteLine("PackageType = " + dpt)
        End Sub
    }

Sample Output:

CertificateContext = 0

CheckpointFileName =

ProtectionLevel = EncryptSensitiveWithUserKey

PackageType = Default

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.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker