473,549 Members | 3,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

running DTS package from windows form using C#

Hi,

Has anyone managed executing a DTS package in SQL Server 2000 from a
windows
form created using c#? Also, I specify the path of the new file
everytime through this windows form.
Please HELP!
I've see examples of windows console based execution, but nothing from
a
windows form.
Help

Feb 14 '06 #1
1 2592
Hi,

"juventusaurabh " <sa************ @gmail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi,

Has anyone managed executing a DTS package in SQL Server 2000 from a
windows
form created using c#? Also, I specify the path of the new file
everytime through this windows form.
Please HELP!


I posted this message yesterday:

This is what I do, I create the DTS in the enterprise manager, when I'm sure
it does work as expected ( data convertion, etc) I save it in disk, this
create a DTS file, later on I use the code below to set the correct data
connections .
You can set a number of other parameters, take a look at the doc, the code
below will give you an idea of how to start
void RunPackage( string packSource, string packName, string dataSource)
{
try
{
Package2Class package = new Package2Class() ;
object pVarPersistStgO fHost = null;

// if you need to load from file
package.LoadFro mStorageFile(
packSource,
null,
null,
null,
packName,
ref pVarPersistStgO fHost);

package._Packag e_Connections.I tem(1).DataSour ce = dataSource;
package.Execute ();
package.UnIniti alize();

// force Release() on COM object
//
System.Runtime. InteropServices .Marshal.Releas eComObject(pack age);
package = null;
}
catch(System.Ru ntime.InteropSe rvices.COMExcep tion e)
{
Console.WriteLi ne("COMExceptio n {0}", e.ErrorCode.ToS tring() );
Console.WriteLi ne("{0}", e.Message);
Console.WriteLi ne("{0}", e.Source);
Console.WriteLi ne("Stack dump\n{0}\n", e.StackTrace);
Console.ReadLin e();
}
catch(System.Ex ception e)
{
Console.WriteLi ne("Exception") ;
Console.WriteLi ne("{0}", e.Message);
Console.WriteLi ne("{0}", e.Source);
Console.WriteLi ne("Stack dump\n{0}\n", e.StackTrace);

Console.ReadLin e();
}
}

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Feb 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3933
by: Frank Conte | last post by:
I'm having a problem running a simple printer friendly script written in PHP. I'm not sure whether the problem is with apache 1.3 or with the scripts. I updated apache's config file httpd.conf to include the directives for running PHP as a loaded module and as CGI as noted in the documentation at php.net # Add to the end of the LoadModule...
2
9731
by: owais | last post by:
H I want to display progress bar during execution of windows form. When I execute DTS package the form will idle till the DTS package finishes Please help me in this regard. its an urgen Thank owais ---
0
1021
by: SSP | last post by:
Hi, Has anyone managed executing a DTS package in SQL Server 2000 from a windows form created using c#? I've see examples of windows console based execution, but nothing from a windows form. Help
1
2188
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used information from Knowledge Base article 306158, INFO: Implementing Impersonation in an ASP.NET Application to create a procedure to perform impersonation. ...
9
3259
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
18
3227
by: rdahlstrom | last post by:
Does anyone know how to determine the window status (Running or Not Responding)? I've tried various methods with no success... This would be on a variety of Windows systems, but all at least XP, and mostly server 2003. Everyone will have Python 2.5.1 on them, and the script would be running locally. Any ideas?
3
6700
by: John | last post by:
Hi. I have a number of batch jobs that are ran nightly on our Windows 2000 based Oracle 8.1.7 (soon to be 9i) server. I have these designed just right, so the Windows Scheduled Tasks runs them and then a parser goes through the output and, in case of errors, sends me a page... The database is our financial system which requires users to...
1
2376
by: =?Utf-8?B?U3ludGF4IDM3NzA3?= | last post by:
I have found lots of people talking about this issue, but no one seems to have a solution. I could really use some help here. Has anyone seen this or have any ideas? I have been running the same backup for 2 years and I came in one morning and it just decided it would not work anymore. Histroy: * Windows 2003 Server
1
8119
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.