469,318 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,318 developers. It's quick & easy.

executing DTS packages in C#

How do you execute a DTS package from C#? I have some code that doesn't
work because the structured storage file cannot be found :

[MTAThread]
static void Main(string[] args)
{
// TODO: Add code to start application here
Package2Class package = new Package2Class();

object pVarPersistStgOfHost = null;

//loadfromsqlserver
package.LoadFromStorageFile(
"c:\\TransferTxtFileToTable.dts",
null,
null,
null,
"Test Package",
ref pVarPersistStgOfHost);

package.Execute();
package.UnInitialize();

package = null;
}

Has anybody else had this problem, and does anybody know how to solve
it? Any help would be really appreciated.
Cheers,

Mike
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
2 6648
null out the name of the package, as below, or correct the name by specifying
the name you named the package when you saved it.

//sample with nulled out package name
package.LoadFromStorageFile(
"c:\\TransferTxtFileToTable.dts",
null,
null,
null,
null,
ref pVarPersistStgOfHost);

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Mike P" wrote:
How do you execute a DTS package from C#? I have some code that doesn't
work because the structured storage file cannot be found :

[MTAThread]
static void Main(string[] args)
{
// TODO: Add code to start application here
Package2Class package = new Package2Class();

object pVarPersistStgOfHost = null;

//loadfromsqlserver
package.LoadFromStorageFile(
"c:\\TransferTxtFileToTable.dts",
null,
null,
null,
"Test Package",
ref pVarPersistStgOfHost);

package.Execute();
package.UnInitialize();

package = null;
}

Has anybody else had this problem, and does anybody know how to solve
it? Any help would be really appreciated.
Cheers,

Mike
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2
Hi Dear Mike P,

see these links.

Using DTS from C#
http://www.c-sharpcorner.com/Code/2002/Sept/DTSnCS.asp
HOW TO: Handle Data Transformation Services Package Events in Visual C#
.NET
http://support.microsoft.com/?id=319985

UI architecture for managing DTS packages
By Narayana Rao Surapaneni, krmpradeep
DTS Follow-up, Web Services, Access Over the Network, and More
http://msdn.microsoft.com/msdnmag/issues/04/01/WebQA/

Bye
Venkat_KL
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Nick Coghlan | last post: by
15 posts views Thread by Nick Coghlan | last post: by
1 post views Thread by Jagannathan Santhanam | last post: by
3 posts views Thread by moxie | last post: by
reply views Thread by giovanni gherdovich | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.