The problem I see is that the Application Class cannot execute a package.
"Allan Mitchell" wrote:
> This would probably be better on the Beta NG but something like this may work. I have not tried this in a long while though
> (probably B1).
>
> Dim a As Application = New Application()
>
> Dim events As IDTSEvents
>
> ' Method 1: Load from the file system
>
> Dim p As Package = a.LoadPackage("c:\foo.dtsx", events)
>
>
>
> ' Method 2: load from SQL server
>
> Dim p2 As Package = a.LoadFromSqlServer("userName", "serverName", "serverUserName", "ServerPassword", events)
>
>
>
> ' Method 3: Load from the service
>
> Dim p3 As Package = a.LoadFromDtsServer("packagePath","serverName", events)
>
>
>
> ' Method 4: Load from an xml document
>
> Dim p4 As Package = New Package()
>
> Dim xmldoc As XmlDocument = New XmlDocument()
>
> xmldoc.Load("c:\package.dtsx")
>
> p4.LoadFromXML(xmldoc.OuterXml, events)
>
>
> --
>
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>
www.SQLDTS.com - The site for all your DTS needs.
>
www.SQLIS.com - SQL Server 2005 Integration Services.
>
www.Konesans.com >
>
> "jimd" <jimd@discussions.microsoft.com> wrote in message news:BA8B0E8D-4BE6-472E-BF1F-6DE448AEC18A@microsoft.com...
> > In SQL2000 I can execute a DTS package with this code just fine
> > DTS.Package2Class test = new DTS.Package2Class();
> > object pVarPersistStgOfHost = null;
> > test.LoadFromSQLServer("myServer",null,null,DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection,null,null,null,"myPackage",ref
> > pVarPersistStgOfHost);
> > test.Execute();
> >
> > However the LoadFromSQLServer method is no longer part of the PackageClass
> > in Yukon it is insead a part of the ApplicationClass which has no execute
> > method.
> >
> > I cannot find any code samples on how to load a yukon package assign
> > variables and execute the package from VS 2005 beta1.
> >
> > Thanks in advance to anyone who can help with this
>
>
>
>