Program
The following code is the DTS package in the Intergration service that calls SQLServer2005 in vb.net (Framework 2.0).
1 if you want to invoke DTS in WebService, you must use the vb.net language. Because if you write WebService in C #, you will not be able to reference the Microsoft.SqlServer.ManagedDTS component.
2 Add the Network Service account to the Administrator group, or you will not be able to execute DTS. (a security vulnerability is created)
1 Imports Microsoft.SqlServer.Dts.Runtime
2
3 ' WebService code
4 <webmethod () > _
5 public Function Executepackage () as Integer
6 Dim pkg as String = "D:\DEVELOPMENT\PROGRAME\PACKAGEDEV\PACKAGE\MG-TSJF-PKG.DTSX"
7
8 Dim app as application = New application ()
9 Dim p as Package = App. Loadpackage (pkg, nothing)
Ten ' P.interactivemode = True
11
Dim vir as Variables = P.variables
Vir ("User::P Ackageid"). Value = 4
14
If P.execute (Nothing, vir, nothing, nothing, nothing) = Dtsexecresult.success Then
0
or Else
Return 1
The End If
End Function