使用带有加密连接字符串的Application.LoadFromSqlServer()加载SSIS包

时间:2021-09-28 03:25:54

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.

从sql server加载SSIS包以在应用程序中使用。

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

使用DTS命令,它需要带有密码的/ DECRYPT选项来解密存储在包中的敏感信息。

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.

ADO NET Destination无法获取连接{DB515DE9-B006-4BFC-AC53-ABED0B77183C}。连接可能已损坏。

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

组件“ADO NET Destination”(841)验证失败,返回错误代码0xC0208452。

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

如何使用C#将解密密码传递给包,以便它可以无误地执行?

1 个解决方案

#1


1  

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

您是否尝试过Application.PackagePassword setter属性?链接到文档: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.

在这个SO问题中也提到了这种方法:如何通过代码在SSIS中执行包密码包? NB根据该链接,您必须在加载包之前在应用程序上指定密码。

#1


1  

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

您是否尝试过Application.PackagePassword setter属性?链接到文档: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.

在这个SO问题中也提到了这种方法:如何通过代码在SSIS中执行包密码包? NB根据该链接,您必须在加载包之前在应用程序上指定密码。