C#中调用SSIS包的问题,急急急!!
我用c#调用SSIS包来更新cube数据时总是提示如下错误:
The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.".
This occurs when CPackage::LoadFromXML fails.
环境vs2005 ,sql server2008
代码如下:
public int ExecuteSSASDts()
{
//DtsRunTime.Application dtsApplication = new DtsRunTime.Application();
string filepath = "E:\\BACH\\QTY\\MM\\GSCS\\MainSource\\NewSource\\Web\\Dashboard\\Package.dtsx";
if (!System.IO.File.Exists(filepath))
{
return 2;
}
// Call SSIS package from SQL Server.
Microsoft.SqlServer.Dts.Runtime.Application application = new Microsoft.SqlServer.Dts.Runtime.Application();
Package package = application.LoadPackage(filepath, null); //运行到这句就包上面的错误
DTSExecResult result = package.Execute();
if (result.Equals(DTSExecResult.Success))
{
return 1;
}
else
{
return 0;
}
}