Hi,
I am trying to run an SSIS package from a VB.Net application. I looked on the net and found a number of examples that were all like the code below.
Assuming that the code works, I am not able to find, in VS 2017, the :Imports Microsoft.SqlServer.Dts.Runtime" statement; it seems to be obsolete. I tried looking in Refferences, but
I did not see anything.
Any ideas of what I can do. or is there another way to do this that would not need it?
Thanks you
I am trying to run an SSIS package from a VB.Net application. I looked on the net and found a number of examples that were all like the code below.
Assuming that the code works, I am not able to find, in VS 2017, the :Imports Microsoft.SqlServer.Dts.Runtime" statement; it seems to be obsolete. I tried looking in Refferences, but
I did not see anything.
Any ideas of what I can do. or is there another way to do this that would not need it?
Thanks you
VB.NET:
Imports Microsoft.SqlServer.Dts.Runtime
Public Class Form1
Private Sub btnStart_Click(sender As System.Object, e As System.EventArgs) Handles btnStart.Click
' Instantiate SSIS application object
Dim myApplication As New Microsoft.SqlServer.Dts.Runtime.Application()
' Load package from file system (use LoadFromSqlServer for SQL Server based packages)
lblStatus.Text = "Loading package from file system."
Dim myPackage As Package = myApplication.LoadPackage("D:\SSIS\MyPackage.dtsx", Nothing)
' Optional set the value from one of the SSIS package variables
myPackage.Variables("User::myVar").Value = "test123"
' Execute package
lblStatus.Text = "Executing package"
Dim myResult As DTSExecResult = myPackage.Execute()
' Show the execution result
lblStatus.Text = "Package result: " & myResult.ToString()
End Sub
End Class