473,466 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DTS from Winform.

I have a WInform app that runs a DTS. When I developed it on the SQL
box and executed it, it ran fine. I used the Trusted connection
parameter for the DTS. I don't want to use passwords. I packaged up
the project and put in on another box. Now I get SQL Server errors:
Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access denied.

Even when I change the connection type for the DTS back to default and
put in the sa password I get the same error.

I know I could make it an ASP.Net app and run it on the SQL Server and
simply use a trusted connection, but I need to use a WInform on a
terminal server. I don't understand why I get an error when I use a
default connection and the sa password, AND when switch it and use a
trusted connection. Are Winforms the same as webform apps as in you
have to do impersonation when they are on different boxes than the SQL
Server? I don't know if I can get the admins to set up an account for
us to cross domain authenticate.

I'm stuck.

Thanks in advance,
John

Jul 21 '05 #1
3 2863
It might help if you try running the DTS package from a stored procedure
instead. The stored procedure can execute the DTS package by calling dtsrun
through xp_cmdshell.

HTH, Jakob.
"jd*****@idealconsulting.com" wrote:
I have a WInform app that runs a DTS. When I developed it on the SQL
box and executed it, it ran fine. I used the Trusted connection
parameter for the DTS. I don't want to use passwords. I packaged up
the project and put in on another box. Now I get SQL Server errors:
Description: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not
exist or access denied.

Even when I change the connection type for the DTS back to default and
put in the sa password I get the same error.

I know I could make it an ASP.Net app and run it on the SQL Server and
simply use a trusted connection, but I need to use a WInform on a
terminal server. I don't understand why I get an error when I use a
default connection and the sa password, AND when switch it and use a
trusted connection. Are Winforms the same as webform apps as in you
have to do impersonation when they are on different boxes than the SQL
Server? I don't know if I can get the admins to set up an account for
us to cross domain authenticate.

I'm stuck.

Thanks in advance,
John

Jul 21 '05 #2
I don't want to. I want to run it from a winform on a remote machine.
I made a test winform program that used SQL Server auth AND Windows
auth and it worked fine:

'cstring = "server=SERVER;database=DYNAMICS;uid=id;pwd=pw d;"
OR
cstring =
"server=SERVER;database=MBSCUSTOM;Trusted_Connecti on=Yes;
con.ConnectionString = cstring
con.Open()
rtbMessage.Text = "Trusted Connection State : " &
con.State.ToString & vbCrLf

Both these statements returned Trusted Connection State : Open from the
remote client. Why won't either of these work in another program on
the same machine that tries to execute a DTS:

package.LoadFromSQLServer(server, id,pwd,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , packageName)
OR
'package.LoadFromSQLServer(server, , ,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
packageName)

I am getting killed here. I'm sure you can run a DTS via VB.Net
Winforms from a remote machine. I can't find anything to help me out.
I'm sure I'm not the only person who has ever tried this. I really
don't want to run it as a web app on the SQL Server box....but that is
my only alternative if I can't get this to work.

Jul 21 '05 #3
It is indeed possible to run a DTS package on a remote server. I have done
it using code similar to the following (C#):

Package2Class package = new Package2Class();
object pVarPersistStgOfHost = null;
DTSSQLServerStorageFlags storageFlags =
DTSSQLServerStorageFlags.DTSSQLStgFlag_Default;
package.LoadFromSQLServer(serverName, serverUserName, serverPassWord,
storageFlags, null, null, null, packageName, ref pVarPersistStgOfHost);
package.Execute();

It also works with a trusted connection (DTSSQLStgFlag_UseTrustedConnection
and null for serverUserName). I also tried it from VB.net and it works as
well.

I while ago I wrote a simple C# class for executing DTS packages which also
sets up connection points for receiving error and progress notifications from
the running package. If you want, I would be glad to e-mail the code to you.

Regards, Jakob.
"jd*****@idealconsulting.com" wrote:
I don't want to. I want to run it from a winform on a remote machine.
I made a test winform program that used SQL Server auth AND Windows
auth and it worked fine:

'cstring = "server=SERVER;database=DYNAMICS;uid=id;pwd=pw d;"
OR
cstring =
"server=SERVER;database=MBSCUSTOM;Trusted_Connecti on=Yes;
con.ConnectionString = cstring
con.Open()
rtbMessage.Text = "Trusted Connection State : " &
con.State.ToString & vbCrLf

Both these statements returned Trusted Connection State : Open from the
remote client. Why won't either of these work in another program on
the same machine that tries to execute a DTS:

package.LoadFromSQLServer(server, id,pwd,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default , , , , packageName)
OR
'package.LoadFromSQLServer(server, , ,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
packageName)

I am getting killed here. I'm sure you can run a DTS via VB.Net
Winforms from a remote machine. I can't find anything to help me out.
I'm sure I'm not the only person who has ever tried this. I really
don't want to run it as a web app on the SQL Server box....but that is
my only alternative if I can't get this to work.

Jul 21 '05 #4

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

Similar topics

2
by: localhost | last post by:
I am looking for any info on creating an MDI WinForms application that uses the "main executable" as a main window container (along with a menu), but can launch other .exe from a menu that act as...
0
by: cgia | last post by:
I found out that only using winform I can use the winword interop and generate word document in the client machine and connect to a remote database, so that I have made a winform application which...
0
by: zbcong | last post by:
hello in my winform,there is a datagrid,i want to fire some actions when the selected index is changed,but i fail to find the SelectedIndexChanged event to the winform datagrid,why? how can i...
0
by: someone | last post by:
Hi, We are encountering a problem with the DTPicker. This is the situation: We have a DTPicker-control on a VB6 Active-X. The Active-X is used on a .NET winform. the problem: The .Net...
3
by: Skc | last post by:
My client's project consists of about 6 files maintenance programs that uses WinForm and grid for updates with lookup finders for each file. There is also a User file and security. There are...
2
by: J.Marsch | last post by:
Ok, so here's a problem you probably don't see every day: We are building an application that must run in a browser, but we need to do some things client-side that would be rather difficult to...
8
by: Sunil Menon | last post by:
Dear All, We are developing applications in ASP.Net...in one of our applications we would like to use a GridControl...we have tried to use a Server-Side Grid control but found the speed to be an...
2
by: jyanmin.fang | last post by:
Hi, In my current project, I need to embed an .NET winform usercontrol in the aspx page (via <Objecttag). This winform usercontrol has an event called DoEvent (void DoEvent()). This winform...
0
by: Tom | last post by:
Hi all -- this is my first posting here and I want to start by saying thank you to all the responders. I have done some searching and reading and have learned a few things I didn't even know to...
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.