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 the code I use now:
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.
What do I need to add to capture the return value? And would I need to do anything in the dts to pass this value aside from just returning it in the stored proc?
Can anyone help?
Thanks,
Ninel