SSIS, .net and C#
-
The following is the exact message I am getting when running the application from Visual Studio 2005, trying to load a .dtsx package. I could not add a screen shot here. The code is so simple that I cannot understand what the path problem is. Failed to open package file "\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx" due to error 0x80070003 "The system cannot find the path specified.". This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format. The. ,dtsx package and code are both located on the server. I can run the .dtsx package fine in BIDS and get the required result. When the code runs to the line "pkg = app.LoadPackage(pkgLocation, eventListener);" that is when I get the "Failed to open package file" error. Below is a re-posting of the actual code: using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Dts.Runtime; namespace DocBeaEntry { class MyEventListener : DefaultEvents { public override bool OnError(DtsObject source, int errorCode, string subComponent, string description, string helpFile, int helpContext, string idofInterfaceWithError) { // Add application-specific diagnostics here. Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);return false; } } public class clsSSIS { public static void RunDTSX() { string pkgLocation; Package pkg; Application app; DTSExecResult pkgResults; MyEventListener eventListener = new MyEventListener(); pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; app = new Application(); pkg = app.LoadPackage(pkgLocation, eventListener); pkgResults = pkg.Execute(null, null, eventListener, null, null);Console.WriteLine(pkgResults.ToString()); } } }
-
The following is the exact message I am getting when running the application from Visual Studio 2005, trying to load a .dtsx package. I could not add a screen shot here. The code is so simple that I cannot understand what the path problem is. Failed to open package file "\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx" due to error 0x80070003 "The system cannot find the path specified.". This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format. The. ,dtsx package and code are both located on the server. I can run the .dtsx package fine in BIDS and get the required result. When the code runs to the line "pkg = app.LoadPackage(pkgLocation, eventListener);" that is when I get the "Failed to open package file" error. Below is a re-posting of the actual code: using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Dts.Runtime; namespace DocBeaEntry { class MyEventListener : DefaultEvents { public override bool OnError(DtsObject source, int errorCode, string subComponent, string description, string helpFile, int helpContext, string idofInterfaceWithError) { // Add application-specific diagnostics here. Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);return false; } } public class clsSSIS { public static void RunDTSX() { string pkgLocation; Package pkg; Application app; DTSExecResult pkgResults; MyEventListener eventListener = new MyEventListener(); pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; app = new Application(); pkg = app.LoadPackage(pkgLocation, eventListener); pkgResults = pkg.Execute(null, null, eventListener, null, null);Console.WriteLine(pkgResults.ToString()); } } }
-
Try changing: pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; to pkgLocation = @".\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx";
unfortunately, I came up with the same error. I just cannot understand what I am doing incorrectly. It has to be caused by something on the server somehow. I actually have the asme code in Vb and it works just fine but the c# code does not want to work past this line. pkg = app.LoadPackage(pkgLocation, eventListener); I have tried the following for the pkglocation, they all give me the same error: Failed to open package file pkgLocation = @".\Serv37\M:\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\\Serv37\M:\wwwroot\AS- MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = "\\Serv37\\wwwroot\\AS-MIS\\LoadBeaPayroll\\LoadBeaPayroll\\package.dtsx"; Any more suggestions anyone?
-
unfortunately, I came up with the same error. I just cannot understand what I am doing incorrectly. It has to be caused by something on the server somehow. I actually have the asme code in Vb and it works just fine but the c# code does not want to work past this line. pkg = app.LoadPackage(pkgLocation, eventListener); I have tried the following for the pkglocation, they all give me the same error: Failed to open package file pkgLocation = @".\Serv37\M:\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\\Serv37\M:\wwwroot\AS- MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = @"\\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; pkgLocation = "\\Serv37\\wwwroot\\AS-MIS\\LoadBeaPayroll\\LoadBeaPayroll\\package.dtsx"; Any more suggestions anyone?
-
The following is the exact message I am getting when running the application from Visual Studio 2005, trying to load a .dtsx package. I could not add a screen shot here. The code is so simple that I cannot understand what the path problem is. Failed to open package file "\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx" due to error 0x80070003 "The system cannot find the path specified.". This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format. The. ,dtsx package and code are both located on the server. I can run the .dtsx package fine in BIDS and get the required result. When the code runs to the line "pkg = app.LoadPackage(pkgLocation, eventListener);" that is when I get the "Failed to open package file" error. Below is a re-posting of the actual code: using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Dts.Runtime; namespace DocBeaEntry { class MyEventListener : DefaultEvents { public override bool OnError(DtsObject source, int errorCode, string subComponent, string description, string helpFile, int helpContext, string idofInterfaceWithError) { // Add application-specific diagnostics here. Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);return false; } } public class clsSSIS { public static void RunDTSX() { string pkgLocation; Package pkg; Application app; DTSExecResult pkgResults; MyEventListener eventListener = new MyEventListener(); pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx"; app = new Application(); pkg = app.LoadPackage(pkgLocation, eventListener); pkgResults = pkg.Execute(null, null, eventListener, null, null);Console.WriteLine(pkgResults.ToString()); } } }
mecca1 wrote:
pkgLocation = @"\Serv37\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx";
try using (i.e)
pkgLocation = @"c:\wwwroot\AS-MIS\LoadBeaPayroll\LoadBeaPayroll\package.dtsx";
in local machine if file location in other machine, make sure you have shared that path and have an access right.dhaim ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro" in the front line gave a lead, in the middle line build goodwill, in the behind give power support