tags:

views:

192

answers:

2

hi guys,

I have created an SSISpackage in my asp.net project.To call the ssis package, i have written the following code.

dim app as new Application()

dim package as Package=app.LoadPackage("C:\Projects\MyPackage.dtsx")

dim result as DTSExeResult=package.Execute()

Response.Write(result.Tostring())

but it shows some errors.i think some namespaces are missing.What all namespaces have to be imported? Please help

+1  A: 

Microsoft.SqlServer.Dts.Runtime

JonoW
+3  A: 

I think the namespace that you're after is:

Microsoft.SqlServer.Dts.Runtime

However, this namespace is found within an assembly that is usually not referenced by default, so you'll have to manually add a reference to the:

Microsoft.SqlServer.ManagedDTS.dll

assembly, if you'er not already referencing it.

Also note that since you're attempting to execute the package from within the context of ASP.NET, you may encounter security/permissions issues. Please see the following links for further details in this regard:

Microsoft.SqlServer.Dts.Runtime & ASP.NET Identity Problem
Calling SSIS package from web service - Security issue Calling SSIS packages from ASP.NET - Packages with file system tasks end abruptly

Also see these general links in running SSIS packages programmatically:

Loading and Running a Local Package Programmatically
Running SSIS package programmatically

That last link contains a very important caveat for attempting to execute SSIS packages specifically from within an ASP.NET context:

ASP.NET specific: the impersonation context does not get passed to additional threads SSIS package creates, so the data source connections will not be impersonated. Also, ASP.NET can be configured to recycle the worker process in case it consumes too much memory to improve availability of ASP.NET application. Since SSIS is likely to consume a lot of memory if you have lots of data, it can trigger this recycling and lower reliability of your application.

CraigTP