Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Application.LoadFromDtsServer Method

Loads a package from the specified server.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

'Declaration
Public Function LoadFromDtsServer ( _
	sPackagePath As String, _
	sServerName As String, _
	pEvents As IDTSEvents _
) As Package
'Usage
Dim instance As Application 
Dim sPackagePath As String 
Dim sServerName As String 
Dim pEvents As IDTSEvents 
Dim returnValue As Package 

returnValue = instance.LoadFromDtsServer(sPackagePath, _
	sServerName, pEvents)

Parameters

sPackagePath
Type: System.String
The fully qualified path of the package.
sServerName
Type: System.String
The server where the package is stored.
pEvents
Type: Microsoft.SqlServer.Dts.Runtime.IDTSEvents
An IDTSEvents interface.

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.

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}

Community Additions

ADD
Show:
© 2015 Microsoft