close
程式碼很簡單,要注意引用DTS,一般位置在 C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspkg.dll。
using DTS;
object pVarPersistStgOfHost = null;
Package2Class package = new Package2Class();
package.LoadFromSQLServer(_IP, _DB_USER, _DB_PWD, DTSSQLServerStorageFlags.DTSSQLStgFlag_Default,
null, null, null, strPackageName, ref pVarPersistStgOfHost);
try
{
package.Execute();
bDTSflag = true;
}
catch(Exception exp)
{
throw exp;
}
finally
{
package.UnInitialize();
package = null;
}
全站熱搜
留言列表