熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

.NET程序調用SSIS中的DTS包

2013-11-13 10:09:56  來源: .NET編程 
    以下代碼是在VBNET(Framework )中調用SQLServer 的Intergration Service中DTS包
   如果要在WebService中調用DTS必須用VBNET語言因為如果用C#編寫WebService的話將無法引用MicrosoftSqlServerManagedDTS組件
   將NETWORK SERVICE帳戶添加到Administrator組中否則將不能執行DTS(會帶來安全漏洞)
  
  
   Imports MicrosoftSqlServerDtsRuntime
  
   WebService代碼
   _
   Public Function ExecutePackage() As Integer
   Dim pkg As String = D:\Development\Programe\PackageDev\Package\MGTSJFPKGdtsx
  
   Dim app As Application = New Application()
   Dim p As Package = appLoadPackage(pkg Nothing)
   pInteractiveMode = True
  
   Dim vir As Variables = pVariables
   vir(用戶::PackageID)Value =
  
   If pExecute(Nothing vir Nothing Nothing Nothing) = DTSExecResultSuccess Then
   Return
   Else
   Return
   End If
   End Function
  
  

From:http://tw.wingwit.com/Article/program/net/201311/12761.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.