Ramesh
Ramesh

Reputation: 1

How to execute SSIS package from windows form applicaiton VB.NET

My idea is to have 2 projects. BYMacroServices and BYTaskScheduler BYMacroServices is to store all SSIS packages (.dtsx). BYTaskScheduler is to write logic to decide when to execute certain package.

What i have done

I already downloaded and installed SSIS. SSIS Extensions

I created a reference folder and added a reference which is Microsoft.SqlServer.ManagedDTS. This dll was obtained from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_13.0.0.0__89845dcd8080cc91

BYTaskScheduler\Form1.vb

Imports Microsoft.SqlServer.Dts.Runtime

Public Class Form1

    Private Sub btnExecutePackage_Click(sender As Object, e As EventArgs) Handles btnExecutePackage.Click
        Dim packagePath As String = "C:\Projects\BYTaskScheduler\BYMacroServices\Package.dtsx"

        ' Create an instance of the SSIS application
        Dim app As New Application()

        ' Load the package
        Dim package As Package = app.LoadPackage(packagePath, Nothing)

        ' Execute the package
        Dim results As DTSExecResult = package.Execute()

        ' Check execution result
        If results = DTSExecResult.Success Then
            MessageBox.Show("Package executed successfully.")
        Else
            MessageBox.Show("Package execution failed.")
        End If
    End Sub

End Class

Error occured

Error occured

System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=16.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.'

i tried searching in C:\Windows\Microsoft.NET\assembly\GAC_MSIL, but could not find the Microsoft.SqlServer.DTSRuntimeWrap. This dll is missing.

SQL Server Integration Services does not running under the SQL Server Services on SQL Server Configuration Manager. It is missing. click

Any solution to successfully execute the SSIS package? Thanks in advance

Upvotes: 0

Views: 58

Answers (0)

Related Questions