Hi all, i am new to DTS packages but am a long time C# programmer. I have created a simple DTS package that imports records from a text file to a destination table using activeX transformations in the data transformation task. The DTS package itself runs flawlessly from Enterprise Manager but when called from C# it runs only sometimes, there are no errors reported it just Executes and then immediately quits. Sometimes it works fine from C# and sometimes it does not, im accessing it using our sa account so permissions should not be an issue. Below is the constructor for the calling app of the DTS package:DTS.Package2Class package = new DTS.Package2Class(); object pVarPersistStgOfHost = null;package.LoadFromSQLServer( "192.168.8.8", "sa", "pwd", Microsoft.SqlServer.DTSPkg80.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, null, null, null, dtsPkg, ref pVarPersistStgOfHost); //remove and re-set the global variables package.GlobalVariables.Remove("sourceFile"); package.GlobalVariables.AddGlobalVariable("sourceFile", f.FullName); package.GlobalVariables.Remove("sourceName"); package.GlobalVariables.AddGlobalVariable("sourceName", f.Name); package.Execute(); package.UnInitialize();
many thanks in advance.