Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DTS package Programming
Message
From
01/07/2005 08:50:55
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
DTS package Programming
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01028093
Message ID:
01028093
Views:
130
All,

The code below is used to run a DTS package. When I run the program it errors out and says the guid is invalid on the LoadFromStorageFile() method. If I use the System.Guid.NewGuid() method the program crashes on the FindConnectionPoint line with a no such interface error message.
  private void RunPackage()
     {
       Package2Class lopackage = new Package2Class();
       UCOMIConnectionPointContainer CnnctPtCont = (UCOMIConnectionPointContainer) lopackage;
       UCOMIConnectionPoint CnnctPt;
       PackageEventsSink loPES = new PackageEventsSink();

       Guid guid = new Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5");  // UUID of PackageEvents Interface
       //Guid guid = System.Guid.NewGuid();  // UUID of PackageEvents Interface

      CnnctPtCont.FindConnectionPoint(ref guid, out CnnctPt);
      int iCookie;
      CnnctPt.Advise(loPES, out iCookie);
      object pVarPersistStgOfHost = null;
      lopackage.LoadFromStorageFile(this.pcDTSFileName, "", guid.ToString(), guid.ToString(), VFPToolkit.files.JustFName(this.pcDTSFileName), ref pVarPersistStgOfHost);
      lopackage.Execute();
      lopackage.UnInitialize();
      lopackage = null;
      CnnctPt.Unadvise(iCookie); //a connection that is created by IConnectionPoint.Advise must be closed by calling IConnectionPoint.Unadvise to avoid a memory leak

}//RunPackage
Thanks

Jim
Reply
Map
View

Click here to load this message in the networking platform