Load SSIS package using Application.LoadFromSqlServer() with an encrypted connection string

StackOverflow https://stackoverflow.com/questions/16237170

Domanda

I'm using

var app = new Application();
var pkg = app.LoadFromSqlServer(ConfigurationManager.AppSettings["SSISPackagePath"],
                                ConfigurationManager.AppSettings["SqlHost"],
                                ConfigurationManager.AppSettings["SqlUser"],
                                ConfigurationManager.AppSettings["SqlPass"], null);

to load an SSIS package from sql server for use in an application.

Using the DTS command it requires a /DECRYPT option with password to decrypt the sensitive information stored in the package.

Without the password I get the following error message:

ADO NET Destination has failed to acquire the connection {DB515DE9-B006-4BFC-AC53-ABED0B77183C}. The connection may have been corrupted.

component "ADO NET Destination" (841) failed validation and returned error code 0xC0208452.

How do I pass the decrypt password to the package using C# so it can execute without error?

È stato utile?

Soluzione

Have you tried the Application.PackagePassword setter property? Link to documentatation: http://technet.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.packagepassword.aspx

This method is also mention in this SO question: How can I execute a package with a package password in SSIS through code?
NB according to that link you have to specify the password on the application BEFORE loading the package.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top