Results 1 to 2 of 2

Thread: Executing a DTS package via .NET

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397

    Executing a DTS package via .NET

    how can i execute a dts package in sql2000? i tried using the code below with no luck.

    the error i get is:
    An unhandled exception of type
    'System.Data.SqlClient.SqlException' occurred in system.data.dll

    Code:
            Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
            Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand
            '
            'SqlConnection1
            '
            Me.SqlConnection1.ConnectionString = "workstation id=""USER"";packet size=4096;integrated security=SSPI;data source" & _
            "=""AUS-REPORTING"";persist security info=False;initial catalog=Log"
    
            Me.SqlCommand1.CommandText = "exec TESTTT"
            Me.SqlCommand1.Connection = Me.SqlConnection1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Me.SqlConnection1.Open()
            Me.SqlCommand1.ExecuteNonQuery()
            Me.SqlConnection1.Close()
    
    
        End Sub

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    i found this on microsofts site.... if you can think of a better way PLEASE let me know.


    Code:
            Dim dtsp As New DTS.Package
            dtsp.LoadFromSQLServer( _
                ServerName:="AUS-REPORTING", _
                ServerUserName:="USER", _
                ServerPassword:="PASSWORD", _
                PackageName:="TESTTT")
            dtsp.Execute()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width