我正在使用
var app = new Application();
var pkg = app.LoadFromSqlServer(ConfigurationManager.AppSettings["SSISPackagePath"],
ConfigurationManager.AppSettings["SqlHost"],
ConfigurationManager.AppSettings["SqlUser"],
ConfigurationManager.AppSettings["SqlPass"], null);
从sql server加载SSIS包以在应用程序中使用.
使用DTS命令,它需要带有密码的/ DECRYPT选项来解密存储在包中的敏感信息.
没有密码我收到以下错误消息:
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.
如何使用C#将解密密码传递给包,以便它可以无错误地执行?
解决方法:
您是否尝试过Application.PackagePassword setter属性?
链接到文件:http://technet.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.packagepassword.aspx
在这个SO问题中也提到了这种方法:How can I execute a package with a package password in SSIS through code?
NB根据该链接,您必须在加载包之前在应用程序上指定密码.