Application.LoadPackage Application.LoadPackage Application.LoadPackage Method

Definition

Lädt ein Paket. Loads a package.

Überlädt

LoadPackage(String, IDTSEvents) LoadPackage(String, IDTSEvents) LoadPackage(String, IDTSEvents)

Lädt Package aus dem Dateisystem. Loads a Package from the file system.

LoadPackage(String, IDTSEvents, Boolean) LoadPackage(String, IDTSEvents, Boolean) LoadPackage(String, IDTSEvents, Boolean)

Lädt eine Package aus dem Dateisystem und gibt das Threadingmodell an. Loads a Package from the file system, and specifies the threading model.

LoadPackage(String, IDTSEvents) LoadPackage(String, IDTSEvents) LoadPackage(String, IDTSEvents)

Lädt Package aus dem Dateisystem. Loads a Package from the file system.

public:
 Microsoft::SqlServer::Dts::Runtime::Package ^ LoadPackage(System::String ^ fileName, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ events);
public Microsoft.SqlServer.Dts.Runtime.Package LoadPackage (string fileName, Microsoft.SqlServer.Dts.Runtime.IDTSEvents events);
Public Function LoadPackage (fileName As String, events As IDTSEvents) As Package

Parameter

fileName
String String String

Der Name der Datei, die das zu ladende Paket enthält. The name of the file that contains the package to load.

events
IDTSEvents IDTSEvents IDTSEvents

Eine IDTSEvents Schnittstelle. An IDTSEvents interface.

Gibt zurück

Das Paket, das geladen wurde. The package that was loaded.

Beispiele

Das folgende Codebeispiel lädt ein Paket aus dem Dateisystem und gibt dann mehrere Eigenschaften für das Paket zurück.The following code example loads a package from the file system, and then returns several properties for the package.

class ApplicationTests  
    {  
        static void Main(string[] args)  
        {  
            // The variable pkg points to the location of the  
            // ExecuteProcess package sample installed with  
            // the SSIS 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);  
           // Now that the package is loaded, we can query on  
           // its properties.  
            int n = p.Configurations.Count;  
            DtsProperty  p2 = p.Properties["VersionGUID"];  
            DTSProtectionLevel pl = p.ProtectionLevel;  
  
            Console.WriteLine("Number of configurations = " + n);  
            Console.WriteLine("VersionGUID = " + p2);  
            Console.WriteLine("ProtectionLevel = " + pl);  
        }  
    }  
Class ApplicationTests  
        Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location of the  
            ' ExecuteProcess package sample installed with  
            ' the SSIS 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)   
           ' Now that the package is loaded, we can query on  
           ' its properties.  
            Dim n As Integer =  p.Configurations.Count   
            Dim p2 As DtsProperty =  p.Properties("VersionGUID")   
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel   
  
            Console.WriteLine("Number of configurations = " + n)  
            Console.WriteLine("VersionGUID = " + p2)  
            Console.WriteLine("ProtectionLevel = " + pl)  
        End Sub  
End Class  

Beispielausgabe:Sample Output:

Number of configurations = 0

VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty

ProtectionLevel = EncryptSensitiveWithUserKey

LoadPackage(String, IDTSEvents, Boolean) LoadPackage(String, IDTSEvents, Boolean) LoadPackage(String, IDTSEvents, Boolean)

Lädt eine Package aus dem Dateisystem und gibt das Threadingmodell an. Loads a Package from the file system, and specifies the threading model.

public:
 Microsoft::SqlServer::Dts::Runtime::Package ^ LoadPackage(System::String ^ fileName, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ events, bool loadNeutral);
public Microsoft.SqlServer.Dts.Runtime.Package LoadPackage (string fileName, Microsoft.SqlServer.Dts.Runtime.IDTSEvents events, bool loadNeutral);
Public Function LoadPackage (fileName As String, events As IDTSEvents, loadNeutral As Boolean) As Package

Parameter

fileName
String String String

Der Name der Datei, die das zu ladende Paket enthält. The name of the file that contains the package to load.

events
IDTSEvents IDTSEvents IDTSEvents

Eine IDTSEvents Schnittstelle. An IDTSEvents interface.

loadNeutral
Boolean Boolean Boolean

Ein Boolean , der angibt, ob das Paket als neutralthreadpaket geladen werden. A Boolean that indicates whether to load the package as neutral threaded. Wenn false, wird das Paket als apartmentthreadpaket geladen. If false, loads the package as apartment threaded.

Gibt zurück

Das Paket, das geladen wurde. The package that was loaded.

Beispiele

Das folgende Codebeispiel lädt ein Paket aus dem Dateisystem, das Festlegen der loadNeutral flag false, und gibt dann mehrere Eigenschaften für das Paket zurück.The following code example loads a package from the file system, setting the loadNeutral flag to false, and then returns several properties for the package.

class ApplicationTests  
    {  
        static void Main(string[] args)  
        {  
            // The variable pkg points to the location of the  
            // ExecuteProcess package sample installed with  
            // the SSIS 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, false);  
           // Now that the package is loaded, we can query on  
           // its properties.  
            int n = p.Configurations.Count;  
            DtsProperty  p2 = p.Properties["VersionGUID"];  
            DTSProtectionLevel pl = p.ProtectionLevel;  
  
            Console.WriteLine("Number of configurations = " + n);  
            Console.WriteLine("VersionGUID = " + p2);  
            Console.WriteLine("ProtectionLevel = " + pl);  
        }  
    }  
Class ApplicationTests  
        Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location of the  
            ' ExecuteProcess package sample installed with  
            ' the SSIS 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,False)   
           ' Now that the package is loaded, we can query on  
           ' its properties.  
            Dim n As Integer =  p.Configurations.Count   
            Dim p2 As DtsProperty =  p.Properties("VersionGUID")   
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel   
  
            Console.WriteLine("Number of configurations = " + n)  
            Console.WriteLine("VersionGUID = " + p2)  
            Console.WriteLine("ProtectionLevel = " + pl)  
        End Sub  
End Class  

Beispielausgabe:Sample Output:

Number of configurations = 0

VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty

ProtectionLevel = EncryptSensitiveWithUserKey

Gilt für: