我想在调用它时将一些变量传入我的SSIS包中,但似乎无法获得正确的语法。将变量传递给SSIS包C#
Microsoft.SqlServer.Dts.Runtime.Wrapper.Application app = new Microsoft.SqlServer.Dts.Runtime.Wrapper.Application();
Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSPackage100 pkg = app.LoadPackage(pkgLocation, false, null);
所以上面位工作,但是当我去添加一个变量它不工作:
pkg.Variables["mode"].Value = "test";
我得到的错误:
'IDTSPackage100' does not contain a definition for 'Variables' and no extension method 'Variables' accepting a first argument of type 'IDTSPackage100' could be found (are you missing a using directive or an assembly reference?)'
如果我没记错,你需要,例如做这样的事情,这是我怎么会得到'sourcePath'在我当前的SSIS包中,我正在使用'string sourcePath = Dts.Variables [“User :: sourcePath”]。Value.ToString();' – MethodMan