The following code is the DTS package in the Intergration Service of SQLServer2005 called in VB.NET (Framework 2.0).
1 If you want to call DTS in WebService, you must use 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, otherwise DTS will not be executed. (Will bring security holes)
1 Imports Microsoft.SqlServer.Dts.Runtime
2
3 'WebService code
4 <WebMethod()> _
5 Public Function ExecutePackage() As Integer
6 Dim pkg As String = "D:DevelopmentProgramePackageDevPackageMG-TSJF-PKG.dtsx"
7
8 Dim app As Application = New Application()
9 Dim p As Package = app.LoadPackage(pkg, Nothing)
10 'p.InteractiveMode = True
11
12 Dim vir As Variables = p.Variables
13 vir("User::PackageID").Value = 4
14
15 If p.Execute(Nothing, vir, Nothing, Nothing, Nothing) = DTSExecResult.Success Then
16 Return 0
17 Else
18 Return 1
19 End If
20 End Function
http://www.cnblogs.com/liguancong/archive/2006/08/29/489681.html