Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

execute SSIS packages from vb.net

$
0
0

Hi!

 

I was following this article http://www.codeproject.com/useritems/Execute_Package_by_C_.asp to execute list of SSIS packages via vb.net. I created a windows application in server A copied the exe file in server B. the SSIS package is in server B. I deployed the package and it runs file vis integration server. below are my codes. everytime i run the exe in server B. I can see the list of packages but when i hit execute button i get error msgs that says "failure" I am not sure how to get more error out of it. I am not sure whats causing this error.

----------------------------

Imports

System.Data.SqlTypes

Imports

System.Data.SqlClient

Imports

Microsoft.SqlServer.Management.Smo

Imports

Microsoft.SqlServer.Management.Smo.Agent

Imports

Microsoft.SqlServer.Dts.Runtime

Imports

Microsoft.SqlServer.Management.Common

Public

Class Form1

Dim app AsNew Microsoft.SqlServer.Dts.Runtime.Application()

Dim pInfos As PackageInfos = app.GetPackageInfos("\\", "SQLKEV", "", "")

 

PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

ForEach pInfo As PackageInfo In pInfos

If pInfo.Name <> "Maintenance Plans"Then

ComboBox1.Items.Add(pInfo.Name)

EndIf

Next

EndSub

 

PrivateSub btnExec_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExec.Click

Dim app As Microsoft.SqlServer.Dts.Runtime.Application

app =

New Microsoft.SqlServer.Dts.Runtime.Application()

Dim pkgResults_Sql As DTSExecResult

Dim pkgIn AsNew Package()

Try

pkgIn = app.LoadFromSqlServer(

"" + ComboBox1.SelectedItem.ToString().Trim(), "SQLKEV", "", "", Nothing)

pkgIn.PackagePassword =

"password21"

pkgResults_Sql = pkgIn.Execute()

MessageBox.Show(pkgResults_Sql.ToString())

Catch ex As Exception

MsgBox(

"this is an exception" + ex.ToString)

EndTry

EndSub

 

End

Class

----------------------------

 

 

 

please help


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>