C#调用SSIS包,包变量赋值
usingDtsRunTime=Microsoft.SqlServer.Dts.Runtime.Wrapper;publicintrunPackage(stringDat...
using DtsRunTime = Microsoft.SqlServer.Dts.Runtime.Wrapper;
public int runPackage(string Date, string Operator)
{
DtsRunTime.Application application = new DtsRunTime.Application();
DtsRunTime.IDTSPackage90 package = application.LoadPackage(packagePath, true, null);
package.Configurations["Date"].ConfigurationString = Date;
package.Configurations["FilePath"].ConfigurationString = filePath+fileName;
package.Configurations["Operator"].ConfigurationString = Operator;
DtsRunTime.DTSExecResult result = package.Execute();
if (result.Equals(DtsRunTime.DTSExecResult.DTSER_SUCCESS))
{ return 0; }
else { return 10; }
}
这种调用SSIS包的方法到底怎么给变量赋值?package.Configurations["Date"].ConfigurationString = Date;这种会报错,我没找到类似的例子,希望得到帮助 展开
public int runPackage(string Date, string Operator)
{
DtsRunTime.Application application = new DtsRunTime.Application();
DtsRunTime.IDTSPackage90 package = application.LoadPackage(packagePath, true, null);
package.Configurations["Date"].ConfigurationString = Date;
package.Configurations["FilePath"].ConfigurationString = filePath+fileName;
package.Configurations["Operator"].ConfigurationString = Operator;
DtsRunTime.DTSExecResult result = package.Execute();
if (result.Equals(DtsRunTime.DTSExecResult.DTSER_SUCCESS))
{ return 0; }
else { return 10; }
}
这种调用SSIS包的方法到底怎么给变量赋值?package.Configurations["Date"].ConfigurationString = Date;这种会报错,我没找到类似的例子,希望得到帮助 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询