views:

1249

answers:

1

I have similar code for vb and .net which runs my SSIS package just fine. The problem is the c# code and .net does not run my .dtsx package. I get all sorts of errors in cluding not being able to find the file on my desktop. I tried remotely running the package and locally. Is it my code. I am not sure what to do next. I do have all the correct references.

//    public class clsSSIS1
 //   {
  //      public static void RunDTSX()
   //     {
   //         string pkgLocation;
   //         pkgLocation = "C:\\Documents and Settings\\otmxm1\\Desktop\\LoadBeaPayroll\\LoadBeaPayroll\\bin\\package.dtsx";

  //              Application app = new Application();
  //              Package package = null;               
   //             Package pkg = app.LoadPackage(pkgLocation, null,true);
                //Package pkg = app.LoadPackage(@"C:\Documents and Settings\otmxm1\Desktop\LoadBeaPayroll\LoadBeaPayroll\bin\package.dtsx", null);
  //              DTSExecResult result = package.Execute();
                //Console.WriteLine (result.ToString);
  //              Console.ReadKey();

 //           }
//        }
//    }
+1  A: 

Why not just execute the "dtexec.exe -f package.dtsx /conf ConfigurationIfYouGotOne" using System.Diagnostics.Process.Start(xxx). Or if the the ssis is deployed to a sqlserver you can execute it with a storedproc

ThorHalvor