从.net调用SSIS包 [英] Calling SSIS package from .Net

查看:253
本文介绍了从.net调用SSIS包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从.NET Windows用户界面调用SSIS包。这两个SSIS和放大器; .net应用程序将在2008年创建的SSIS包存储在文件系统中。当我运行.net应用程序中我得到了错误:

I am calling SSIS package from a .Net windows UI. Both SSIS & .Net app are created in 2008. The SSIS package is stored in file system. When I ran .Net app I got error:

包失败,原因是加载   错误的0xC0011008错误加载   XML。没有进一步详细的错误   信息可以为该指定   问题是因为没有活动的对象是   其中,通过详细的错误   信息可以存储。此。   发生在CPackage :: LoadFromXML   失败。

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.

异常详细信息 -

Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException was unhandled
  HelpLink="#-1073659847"
  Message="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.\r\n"
  Source=""
  ErrorCode=-1073672184
  StackTrace:
       at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, IDTSEvents events, Boolean loadNeutral)
       at SSISCall.Form1.Execute_Click(Object sender, EventArgs e) in D:\SSISCall\SSISCall\Form1.cs:line 36
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at SSISCall.Program.Main() in D:\SSISCall\SSISCall\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       HelpLink="#-1073659847"
       Message="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.\r\n"
       Source=""
       ErrorCode=-1073672184
       StackTrace:
            at Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass.LoadPackage(String FileName, Boolean loadNeutral, IDTSEvents90 pEvents)
            at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, IDTSEvents events, Boolean loadNeutral)
       InnerException:

这是我使用的code是很简单的:

The code that I am using is very simple:

string packageLocation;
Package ssisPackage;
Microsoft.SqlServer.Dts.Runtime.
Application ssisApplication;
DTSExecResult ssisPackageResult;
packageLocation =@"D:\SSISCall\Package.dtsx";
ssisApplication =new Microsoft.SqlServer.Dts.Runtime.Application();
ssisPackage = ssisApplication.LoadPackage(packageLocation,null); ----Getting error here
ssisPackageResult = ssisPackage.Execute();
Console.WriteLine(ssisPackageResult.ToString());
Console.ReadKey();

请建议。

推荐答案

你有安装在计算机上,你在执行这个包SSIS组件?如果不是,也不会跑 - 见 http://msdn.microsoft.com /en-us/library/ms403348.aspx

Do you have SSIS components installed on the computer where you are executing this package? If not, it won't run - see http://msdn.microsoft.com/en-us/library/ms403348.aspx

时的SSIS安装在计算机上的2008年的版本?如果没有,它不会运行 - 2005年和2008份不能互换

Is the version of SSIS installed on the computer 2008? If not, it won't run - 2005 and 2008 parts are not interchangeable.

是驱动器D映射驱动器?如果是这样,你的code可能不会自动运行(与一个不登录的用户会话) - 使用UNC路径来代替

Is drive "D" a mapped drive? If so, your code probably won't run unattended (with a not-logged-in user session) - use UNC paths instead.

这篇关于从.net调用SSIS包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆