다음을 통해 공유


Application.LoadFromDtsServer Method

Loads a package from the specified server.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Function LoadFromDtsServer ( _
    sPackagePath As String, _
    sServerName As String, _
    pEvents As IDTSEvents _
) As Package
public Package LoadFromDtsServer (
    string sPackagePath,
    string sServerName,
    IDTSEvents pEvents
)
public:
Package^ LoadFromDtsServer (
    String^ sPackagePath, 
    String^ sServerName, 
    IDTSEvents^ pEvents
)
public Package LoadFromDtsServer (
    String sPackagePath, 
    String sServerName, 
    IDTSEvents pEvents
)
public function LoadFromDtsServer (
    sPackagePath : String, 
    sServerName : String, 
    pEvents : IDTSEvents
) : Package

매개 변수

  • sPackagePath
    The fully qualified path of the package.
  • sServerName
    The server where the package is stored.

반환 값

A Package object.

The following code example retrieves two packages, named myp1Package and myp2Package, which were previously saved to the File System folder of the Integration Services service.

static void Main(string[] args)
        {
            Application app = new Application();
            // Load the packages.
            Package p1 = app.LoadFromDtsServer(@"File System\myp1Package", "yourserver", null);
            Package p2 = app.LoadFromDtsServer(@"File System\myp2Package", "yourserver", null);
            // Retrieve the ID (GUID) from the packages for display.
            String p1_ID = p1.ID;
            String p2_ID = p2.ID;
            Console.WriteLine("ID for myp1Package = " + p1_ID);
            Console.WriteLine("ID for myp2Package = " + p2_ID);
        }
Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            ' Load the packages.
            Dim p1 As Package =  app.LoadFromDtsServer("File System\myp1Package","yourserver",Nothing) 
            Dim p2 As Package =  app.LoadFromDtsServer("File System\myp2Package","yourserver",Nothing) 
            ' Retrieve the ID (GUID) from the packages for display.
            Dim p1_ID As String =  p1.ID 
            Dim p2_ID As String =  p2.ID 
            Console.WriteLine("ID for myp1Package = " + p1_ID)
            Console.WriteLine("ID for myp2Package = " + p2_ID)
End Sub

Sample Output:

ID for myp1Package = {598607C7-9C17-487D-A545-8D1C35FBF6E2}

ID for myp2Package = {F0D2E396-A6A5-42AE-9467-04CE946A810C}

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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