all groups > sql server dts > march 2004 >
You're in the

sql server dts

group:

DTS Package can not execute using C#


DTS Package can not execute using C# Hemanth
3/19/2004 8:01:17 AM
sql server dts:
Hi all
I am using the following code to execute a DTS Pakage. It loads the package but it doesnt execute and it doesnt give any exception. If anybody have any idea on how to fix this behaviour please let me know asap.

tr


DTS.Package2 oPkg = new DTS.Package2Class()
object pVarPersistStgOfHost = null
oPkg.LoadFromSQLServer("PROD-D1","sa","xyz",DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default,"","","","MODIFIED_0010_0020",ref pVarPersistStgOfHost)
MessageBox.Show("package Loaded")
oPkg.StartPreparationForStepsExecutingOnMainThread()
MessageBox.Show(oPkg.Steps.Count.ToString()); // This works Well
MessageBox.Show(oPkg.Tasks.Count.ToString()); // This works well and gives the right count
oPkg.Execute(); // Doesnt execute
oPkg.UnInitialize()
oPkg = null

catch(Exception err

MessageBox.Show(err.Message)


Re: DTS Package can not execute using C# Partha Mandayam
3/19/2004 12:02:45 PM
The correct url is

http://support.microsoft.com/default.aspx?scid=kb;en-us;319985

Check the detailed example on this page.

Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com


*** Sent via Developersdex http://www.developersdex.com ***
Re: DTS Package can not execute using C# Partha Mandayam
3/19/2004 2:22:07 PM
You had the closing bracket [)] included in your hyperlink - hence it
would not work.

Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com


*** Sent via Developersdex http://www.developersdex.com ***
Re: DTS Package can not execute using C# Partha Mandayam
3/19/2004 3:02:21 PM
You only included the closing bracket in the url and left out the
opening bracket. So when the hyperlink was clicked, I got a page not
found error but if I copied the entire url into the browser it worked
fine. So the url was actually correct but while making the hyperlink,
you added an extra bracket at the end and hence the browser could not
find it!


Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com


*** Sent via Developersdex http://www.developersdex.com ***
Re: DTS Package can not execute using C# Darren Green
3/19/2004 6:07:14 PM
In message <29AF5648-1ED5-4C7A-A245-476A0E0FCB2C@microsoft.com>, Hemanth
<ramu_kamishetty@yahoo.com> writes
[quoted text, click to view]

You need to capture the error information from the package. It will not
raise an exception all the way up. Use events or GetExecutionErrorInfo.

319985 - HOW TO: Handle Data Transformation Services Package Events in
Visual C# .NET
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;319985)

240221 - HOW TO: Handle Errors in Data Transformation Services "Package"
and "Step" Objects
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;240221)

More .Net and DTS stuff-

DTS Cookbook for .NET
(http://www.sqldev.net/dts/DotNETCookBook.htm)


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

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: DTS Package can not execute using C# Darren Green
3/19/2004 9:50:29 PM
In message <u3BSm0eDEHA.712@tk2msftngp13.phx.gbl>, Partha Mandayam
<mcp111@hotmail.com> writes
[quoted text, click to view]

What was incorrect about the Url I posted?

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

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: DTS Package can not execute using C# Darren Green
3/19/2004 10:27:44 PM
In message <OlPbeCgDEHA.2424@TK2MSFTNGP09.phx.gbl>, Partha Mandayam
<mcp111@hotmail.com> writes
[quoted text, click to view]

The entire Url was wrapped in brackets. I was under the impression that
this prevented some newsreaders from wrapping Urls. Did it cause you a
problem? If so what newsreader?

Cheers

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

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: DTS Package can not execute using C# Darren Green
3/20/2004 10:12:20 AM
In message <uu588YgDEHA.628@TK2MSFTNGP10.phx.gbl>, Partha Mandayam
<mcp111@hotmail.com> writes
[quoted text, click to view]
Partha,

What newsreader as you using? I see it wrapped properly, the three Url
lines all start and end with brackets, opening and closing respectively.
Perhaps it is an issue with your news reader thinking it is a quoted
text section? Just a guess.

I checked Google, and also asked another poster, and it looks and works
OK for both-

http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Q4PQXt
HSbzWAFwbz%40sqldts.com


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

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: DTS Package can not execute using C# Partha Mandayam
3/20/2004 12:59:04 PM
I am using developersdex.com and here it shows the closing bracket as
part of the url but not the opening bracket. But the link to google
which you included in the previous post shows it correctly, both the
closing and opening brackets are not included in the hyperlink and it
works fine. Perhaps it is a newsreader issue. Sorry for the confusion.

Regards

Partha Mandayam
Software Consultant
Home page: http://partha.tripod.com


*** Sent via Developersdex http://www.developersdex.com ***
Re: DTS Package can not execute using C# Darren Green
3/21/2004 5:55:32 PM
In message <#ZQfu4rDEHA.3748@TK2MSFTNGP11.phx.gbl>, Partha Mandayam
<mcp111@hotmail.com> writes
[quoted text, click to view]
Doh!

Sorry, I can't believe I was so stupid not to notice, what with it being
stuck on the bottom of every post you make! It was a feature of
Developersdex rendering engine. I sent them a mail, and it's fixed
already!

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

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