Application.LoadPackage 메서드

정의

패키지를 로드합니다.

오버로드

LoadPackage(String, IDTSEvents)

파일 시스템에서 Package를 로드합니다.

LoadPackage(String, IDTSEvents, Boolean)

파일 시스템에서 Package를 로드하고 스레딩 모델을 지정합니다.

LoadPackage(String, IDTSEvents)

파일 시스템에서 Package를 로드합니다.

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);
member this.LoadPackage : string * Microsoft.SqlServer.Dts.Runtime.IDTSEvents -> Microsoft.SqlServer.Dts.Runtime.Package
Public Function LoadPackage (fileName As String, events As IDTSEvents) As Package

매개 변수

fileName
String

로드할 패키지가 포함된 파일의 이름입니다.

events
IDTSEvents

IDTSEvents 인터페이스입니다.

반환

로드한 패키지입니다.

예제

다음 코드 예제에서는 파일 시스템에서 패키지를 로드한 다음 패키지에 대한 여러 속성을 반환합니다.

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  

샘플 출력:

Number of configurations = 0

VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty

ProtectionLevel = EncryptSensitiveWithUserKey

적용 대상

LoadPackage(String, IDTSEvents, Boolean)

파일 시스템에서 Package를 로드하고 스레딩 모델을 지정합니다.

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);
member this.LoadPackage : string * Microsoft.SqlServer.Dts.Runtime.IDTSEvents * bool -> Microsoft.SqlServer.Dts.Runtime.Package
Public Function LoadPackage (fileName As String, events As IDTSEvents, loadNeutral As Boolean) As Package

매개 변수

fileName
String

로드할 패키지가 포함된 파일의 이름입니다.

events
IDTSEvents

IDTSEvents 인터페이스입니다.

loadNeutral
Boolean

패키지를 중립 스레드로 로드할지 여부를 나타내는 부울입니다. false이면 패키지를 아파트 스레드로 로드합니다.

반환

로드한 패키지입니다.

예제

다음 코드 예제에서는 파일 시스템에서 패키지를 로드 하 고 플래그를 설정 loadNeutralfalse고 패키지에 대 한 몇 가지 속성을 반환 합니다.

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  

샘플 출력:

Number of configurations = 0

VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty

ProtectionLevel = EncryptSensitiveWithUserKey

적용 대상