bitolexus
asked on
Executing SSIS FROM c#
I have an ssis package that uses a dtscofing file it imports data from a csv file to a sql server table. It works fine when run from Business Intelligence studio. When I call it from C# it fails. I have spend hours debug this code and no progress. Here sample code:
Configuration.ProductConfi guration config = new ProductConfiguration();
Microsoft.SqlServer.Dts.Ru ntime.Appl ication app = new Microsoft.SqlServer.Dts.Ru ntime.Appl ication();
Package package = app.LoadPackage(ProductCon figuration .UpdateSku SSIS, null);
package.ImportConfiguratio nFile(Prod uctConfigu ration.Upd ateSkuConf igFile);
DTSExecResult result = package.Execute();
Please help!!!
Configuration.ProductConfi
Microsoft.SqlServer.Dts.Ru
Package package = app.LoadPackage(ProductCon
package.ImportConfiguratio
DTSExecResult result = package.Execute();
Please help!!!
Take a look on this:
http://pedrocgd.blogspot.com/2008/02/ssis-execute-package-from-aspnet-page.html
regards,
Pedro
http://pedrocgd.blogspot.com/2008/02/ssis-execute-package-from-aspnet-page.html
regards,
Pedro
ASKER
My code is doing something similar. My dtsConfig and dtsx locations are coming from the app.config. I exported all user variables into the dtsconfig. I am assuming they should be automatically loaded . Its really annoying BI studio execute the same package without problem. One I should let you know is that I renamed the package but I don't think that is an issue.
If you take out the config file and hard code the variables in, does it work?
Are you passing in variables from c# or reading from within SSIS?
ASKER
There are 3 variables which hold path for csv loaction, archive folder and error folder. the value are in ssis. my package has a dtsconfig which holds the same values. I am passing dtsx file location and dtsconfig file location from C#. I have tried to invoke validate method of the Package before invoking execute and it returns success.
Is there error in c# or in SSIS? Do you have an SSIS error log you can post?
ASKER
no error in ssis, c# returns enum DTSExecResult.Failure
Your best bet is to set logging and see exactly what is happening when you run via c#.
http://msdn.microsoft.com/en-us/library/ms141212.aspx
If you can post the log, then Pedro and I may be able to assist what the issue is.
http://msdn.microsoft.com/en-us/library/ms141212.aspx
If you can post the log, then Pedro and I may be able to assist what the issue is.
ASKER
Here is my log file
log.txt
log.txt
It looks as if you need to install all of SSIS on the work station running your c# code. My guess is you do that install and your package should run fine from your app.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
u r correct
http://www.codeproject.com/KB/database/CallSSISFromCSharp.aspx