dbTalk Databases Forums  

DTS and VB .NET --Capturing Return Value of stored proc

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


Discuss DTS and VB .NET --Capturing Return Value of stored proc in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ninel gorbunov via SQLMonster.com
 
Posts: n/a

Default DTS and VB .NET --Capturing Return Value of stored proc - 08-18-2005 , 09:12 AM






I am executing a DTS package from vb.net. This package executes a stored proc
which is supposed to return a return value.

Here is my .net code:
Code:
Code:
Dim oPkg As DTS.Package2 Dim oStep As DTS.Step2 Dim results As Boolean results = True oPkg = New DTS.Package2 oPkg.LoadFromSQLServer(ServerName:="NINEL-D246655F1", ServerUserName: ="timecontroluser", ServerPassword:="timecontroluser", PackageName: ="ExportTSRLog") oPkg.GlobalVariables.Remove("sCalldate") oPkg.GlobalVariables.AddGlobalVariable("sCalldate", sCalldate) For Each oStep In oPkg.Steps oStep.ExecuteInMainThread = True Next oPkg.FailOnError = True oPkg.Execute() For Each oStep In oPkg.Steps If oStep.ExecutionResult = DTS.DTSStepExecResult. DTSStepExecResult_Failure Then results = False End If Next If results = True Then lblResult.Visible = True lblResult.Text = "TSRLogs have been exported" End If oPkg.UnInitialize() oStep = Nothing oPkg = Nothing ExecuteDTS = results
I can not figure out how to capture this value on the vb.net side.
Do I need to do something special in the DTS package aside from just setting
the reeturn value in the stored procedure?

Can anyone help?

Thanks,
Ninel


--
Message posted via http://www.sqlmonster.com

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS and VB .NET --Capturing Return Value of stored proc - 08-18-2005 , 12:40 PM






You can use a Script task to capture the value to a Global Variable. In
your VB.Net code you capture the global variable fter the package has
executed.

Global Variables and Stored Procedure Parameters
(http://www.sqldts.com/default.aspx?234)

Allan


"ninel gorbunov via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
I am executing a DTS package from vb.net. This package executes a stored
proc
which is supposed to return a return value.

Here is my .net code:
Code:
Code:
Dim oPkg As DTS.Package2 Dim oStep As DTS.Step2 Dim results As Boolean results = True oPkg = New DTS.Package2 oPkg.LoadFromSQLServer(ServerName:="NINEL-D246655F1", ServerUserName: ="timecontroluser", ServerPassword:="timecontroluser", PackageName: ="ExportTSRLog") oPkg.GlobalVariables.Remove("sCalldate") oPkg.GlobalVariables.AddGlobalVariable("sCalldate", sCalldate) For Each oStep In oPkg.Steps oStep.ExecuteInMainThread = True Next oPkg.FailOnError = True oPkg.Execute() For Each oStep In oPkg.Steps If oStep.ExecutionResult = DTS.DTSStepExecResult. DTSStepExecResult_Failure Then results = False End If Next If results = True Then lblResult.Visible = True lblResult.Text = "TSRLogs have been exported" End If oPkg.UnInitialize() oStep = Nothing oPkg = Nothing ExecuteDTS = results
I can not figure out how to capture this value on the vb.net side.
Do I need to do something special in the DTS package aside from just
setting
the reeturn value in the stored procedure?

Can anyone help?

Thanks,
Ninel


--
Message posted via http://www.sqlmonster.com



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.