Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DTS package Programming
Message
De
01/07/2005 08:50:55
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
DTS package Programming
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01028093
Message ID:
01028093
Vues:
129
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
Répondre
Fil
Voir

Click here to load this message in the networking platform