Solved

Executing SSIS FROM c#

Posted on 2010-09-23
13
883 Views
Last Modified: 2013-12-16
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.ProductConfiguration config = new ProductConfiguration();
                Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
                Package package = app.LoadPackage(ProductConfiguration.UpdateSkuSSIS, null);
                package.ImportConfigurationFile(ProductConfiguration.UpdateSkuConfigFile);
                DTSExecResult result = package.Execute();

Please help!!!
0
Comment
Question by:bitolexus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 16

Expert Comment

by:carsRST
ID: 33745797
See this link.  It will walk you step by step.  

http://www.codeproject.com/KB/database/CallSSISFromCSharp.aspx
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 33746273
0
 

Author Comment

by:bitolexus
ID: 33747142
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:carsRST
ID: 33747261
If you take out the config file and hard code the variables in, does it work?
0
 
LVL 16

Expert Comment

by:carsRST
ID: 33747332
Are you passing in variables from c# or reading from within SSIS?
0
 

Author Comment

by:bitolexus
ID: 33747882
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.
0
 
LVL 16

Expert Comment

by:carsRST
ID: 33747961
Is there error in c# or in SSIS?  Do you have an SSIS error log you can post?
0
 

Author Comment

by:bitolexus
ID: 33749336
no error in ssis, c# returns enum DTSExecResult.Failure
0
 
LVL 16

Expert Comment

by:carsRST
ID: 33750472
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.
0
 

Author Comment

by:bitolexus
ID: 33752318
Here is my log file
log.txt
0
 
LVL 16

Expert Comment

by:carsRST
ID: 33752735
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.
0
 
LVL 12

Accepted Solution

by:
ill earned 250 total points
ID: 33849862
Log file suggest, that SQL server editions are not the same. BI studio is probably using SQL developer edition ( basically same as enterprise), but production server runs other( SQL standard perhaps? ).
Functionality that is included in BI studio is missing on server.
Run 'select @@version' to check for status.
0
 

Author Closing Comment

by:bitolexus
ID: 33853605
u r correct
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question