dbTalk Databases Forums  

DTS Execute in .NET Web app using c#

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


Discuss DTS Execute in .NET Web app using c# in the microsoft.public.sqlserver.dts forum.



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

Default DTS Execute in .NET Web app using c# - 08-11-2004 , 06:47 PM






I am not sure how to debug my code.

I am Executing adts package within .cs code in a .Net Web Application.

The code compiles and runs with no errors.
I rum package.Execute();

My dts package has six steps. The first one gets executed. Then a logout
occurs.

What am I doing wrong here?

If there a package timeout?
Does Execute() expect the package to have just one step?



Reply With Quote
  #2  
Old   
Kevinlife
 
Posts: n/a

Default RE: DTS Execute in .NET Web app using c# - 08-11-2004 , 08:15 PM






If you want to trace DTS error, you must use this code!!
===code start===
private string[] tracePackageError(DTS.Package2 oPackage)
{
int ErrorCode = 0;
string ErrorSource = "";
string ErrorDescription = "";
string ErrorHelpFile = "";
int ErrorHelpContext = 0;
string ErrorIDofInterfaceWithError = "";

for(int i=1;i<oPackage.Steps.Count+1;i++)
{
if(oPackage.Steps.Item(i).ExecutionResult ==
DTS.DTSStepExecResult.DTSStepExecResult_Failure)
{
oPackage.Steps.Item(i).GetExecutionErrorInfo(out ErrorCode, out
ErrorSource, out ErrorDescription, out ErrorHelpFile, out ErrorHelpContext,
out ErrorIDofInterfaceWithError);
}
}
string[] tmpReturn = new string[]{oPackage.Name, ErrorCode.ToString(),
ErrorSource, ErrorDescription, ErrorHelpFile, ErrorHelpContext.ToString(),
ErrorIDofInterfaceWithError};
return tmpReturn;
}
===code end===

"jmv" wrote:

Quote:
I am not sure how to debug my code.

I am Executing adts package within .cs code in a .Net Web Application.

The code compiles and runs with no errors.
I rum package.Execute();

My dts package has six steps. The first one gets executed. Then a logout
occurs.

What am I doing wrong here?

If there a package timeout?
Does Execute() expect the package to have just one step?



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

Default Re: DTS Execute in .NET Web app using c# - 08-12-2004 , 12:23 PM



You can use other code, such as event handlers which can be a better
solution depending on the application-

319985 - HOW TO: Handle Data Transformation Services Package Events in
Visual C# .NET
(http://support.microsoft.com/default...9985&Product=s
ql2k)


In message <BBCF5E62-5B79-4C1F-8D5F-EB50679ABB1F (AT) microsoft (DOT) com>,
Kevinlife <Kevinlife (AT) discussions (DOT) microsoft.com> writes
Quote:
If you want to trace DTS error, you must use this code!!
<snip>


--
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
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.