dbTalk Databases Forums  

CPackage::LoadFromXML fails while loading a dtsx from C#

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss CPackage::LoadFromXML fails while loading a dtsx from C# in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Romain Yvonnet
 
Posts: n/a

Default CPackage::LoadFromXML fails while loading a dtsx from C# - 10-26-2006 , 11:04 AM






Hello,

I use this code to load a dtsx from my C# code :

public static FileStream[] LaunchSSISFileMode(string pckgPath,
string pckgConfigPath, Dictionary<string, Object> variables, out DateTime
endedAt, out List<string> errors, out Boolean lastStatus)
{
try
{
Microsoft.SqlServer.Dts.Runtime.Application app = new
Microsoft.SqlServer.Dts.Runtime.Application();

Package package = app.LoadPackage(pckgPath, null);

package.ImportConfigurationFile(pckgConfigPath);
Variables vars = package.Variables;

foreach(string sKey in variables.Keys)
{
vars[sKey].Value = variables[sKey];
}

DTSExecResult result = package.Execute();
errors = new List<string>();
foreach (DtsError err in package.Errors)
{
errors.Add(err.Description);
}
lastStatus = (package.Errors.Count == 0);
endedAt = package.StopTime;

return null;
}

catch (DtsException dtsExc)
{
errors = new List<string>();
errors.Add(dtsExc.Message);
lastStatus = false;
endedAt = DateTime.Now;
return null;
}


A UI calls through remoting this piece of code.
It works well on my computer with SQL Server 2005 installed and both the UI
and server component, but it doesn't if I use a distant server component with
the same configuration.
The error is :
"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."

The package is present on the server at the right place (if I specify a
wrong path the error is different, I tried).

Thanks for help

Best regards.

Romain


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.