Wrox Programmer Forums
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2005, 08:32 AM
Authorized User
 
Join Date: Mar 2005
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default DTS and VB.net

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







Similar Threads
Thread Thread Starter Forum Replies Last Post
DTS and VB.NET jelenavukicevic SQL Server DTS 0 June 14th, 2006 02:50 AM
vb.net DTS interaction marclena General .NET 1 January 23rd, 2005 08:54 AM
dts and vb.net collie SQL Server DTS 1 November 27th, 2004 10:13 AM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 05:01 PM
DTS packages from VB 6 to VB .NET petroleo SQL Server DTS 0 August 18th, 2003 04:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.