dbTalk Databases Forums  

Package.Execute code no longer works in Yukon

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


Discuss Package.Execute code no longer works in Yukon in the microsoft.public.sqlserver.dts forum.



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

Default Package.Execute code no longer works in Yukon - 11-23-2004 , 05:49 PM






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.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,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

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-24-2004 , 12:55 AM






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 (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,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



Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-24-2004 , 01:06 AM



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 (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,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





Reply With Quote
  #4  
Old   
jimd
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-24-2004 , 02:19 PM



Thanks for the reply and the code examples
The problem I see is that the Application Class cannot execute a package.
While the Package Class can execute, however, it cannot load the package
from SQL or DTS

I am confused why there isn't isn't a LoadFromSQLServer method on the
Package Class or a way to transfer the Package information from Application()
to Package()

thanks again for any help

"Allan Mitchell" wrote:

Quote:
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 (AT) discussions (DOT) microsoft.com> wrote

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.DT SSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedCon nection,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






Reply With Quote
  #5  
Old   
Darren Green
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-24-2004 , 04:25 PM



In message <7C854FA5-6AC8-469C-A3FB-699CBC734C89 (AT) microsoft (DOT) com>, jimd
<jimd (AT) discussions (DOT) microsoft.com> writes
Quote:
Thanks for the reply and the code examples
The problem I see is that the Application Class cannot execute a package.
While the Package Class can execute, however, it cannot load the package
from SQL or DTS

I am confused why there isn't isn't a LoadFromSQLServer method on the
Package Class or a way to transfer the Package information from Application()
to Package()

The object model is basically a new object model, so you now use the
application to load a package. You use the package class to store that
package, as loaded via the application, so why does there need to be a
load method on the package class?

Yes it is all new, and a bit of learning curve, but is there actually
something missing, or something that you cannot do?


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #6  
Old   
jimd
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-29-2004 , 03:35 PM



I cannot find any samples on executing a SQL 2005 package using VS 2005 .
All I found was saving the package as XML from the application and then using
the package class to load and execute that xml.

thanks again for the replies

"Darren Green" wrote:

Quote:
In message <7C854FA5-6AC8-469C-A3FB-699CBC734C89 (AT) microsoft (DOT) com>, jimd
jimd (AT) discussions (DOT) microsoft.com> writes
Thanks for the reply and the code examples
The problem I see is that the Application Class cannot execute a package.
While the Package Class can execute, however, it cannot load the package
from SQL or DTS

I am confused why there isn't isn't a LoadFromSQLServer method on the
Package Class or a way to transfer the Package information from Application()
to Package()


The object model is basically a new object model, so you now use the
application to load a package. You use the package class to store that
package, as loaded via the application, so why does there need to be a
load method on the package class?

Yes it is all new, and a bit of learning curve, but is there actually
something missing, or something that you cannot do?


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #7  
Old   
jimd
 
Posts: n/a

Default Re: Package.Execute code no longer works in Yukon - 11-30-2004 , 02:25 PM



Nevermind I got it. I just needed to sit back for a moment and think it over.
Just for anyone else who is interested here is the code

Package test = new Package();
IDTSEvents testagain = null;
Microsoft.SqlServer.Dts.Runtime.Application myapp = new
Microsoft.SqlServer.Dts.Runtime.Application();
test = myapp.LoadFromSqlServer("DTS_TEST", "myServer", null, null, testagain);
test.Execute();

"jimd" wrote:

Quote:
I cannot find any samples on executing a SQL 2005 package using VS 2005 .
All I found was saving the package as XML from the application and then using
the package class to load and execute that xml.

thanks again for the replies

"Darren Green" wrote:

In message <7C854FA5-6AC8-469C-A3FB-699CBC734C89 (AT) microsoft (DOT) com>, jimd
jimd (AT) discussions (DOT) microsoft.com> writes
Thanks for the reply and the code examples
The problem I see is that the Application Class cannot execute a package.
While the Package Class can execute, however, it cannot load the package
from SQL or DTS

I am confused why there isn't isn't a LoadFromSQLServer method on the
Package Class or a way to transfer the Package information from Application()
to Package()


The object model is basically a new object model, so you now use the
application to load a package. You use the package class to store that
package, as loaded via the application, so why does there need to be a
load method on the package class?

Yes it is all new, and a bit of learning curve, but is there actually
something missing, or something that you cannot do?


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #8  
Old   
Hui
 
Posts: n/a

Default RE: Package.Execute code no longer works in Yukon - 12-16-2009 , 04:46 PM



I have exactly the same scenario, could you post your solution? Thanks.

From http://www.developmentnow.com/g/103_...s-in-Yukon.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

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.