SSIS Package Load error

  • I am trying to programatically run an SSIS package from vb.net but I am getting the following error on the 'loadpackage' call

    0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information ...etc 

    Here is the code...

    Private Sub backgroundWorker2_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Handles BackgroundWorker2.DoWork

    Dim pkgLocation As String

    Dim pkg As New Package

    Dim app As New Application

    Dim pkgResults As DTSExecResult

    Dim autoEvent As New AutoResetEvent(False)

    pkgLocation = e.Argument.ToString()

    pkg = app.LoadPackage(pkgLocation,

    Nothing)  ' this is the error line

    pkgResults = pkg.Execute()

    If pkgResults = DTSExecResult.Success Then

    e.Result =

    "Success"

    Else

    e.Result =

    "Failed"

    End If

    end sub

    As you can see this is running on a worker thread.

    the packages run fine from Visual Studio 2005 in the Business Intelligence project but will not load under VB

    Does anyone have any ideas?

    Thanks and regards

  • not sure about this error - I've used something similar to this in the past -

    Imports System.Data.SqlTypes

    Imports Microsoft.SqlServer.Dts.Runtime

    Imports Microsoft.SqlServer.Management.Smo

    Imports Microsoft.SqlServer.Managment.Smo.Agent

    Imports Microsoft.SqlServer.Managment.Common

    Imports System.Data.SqlClient

    Dim app As New Microsoft.SqlServer.Dts.Runtime.Application()

    Dim pInfos As PackageInfos = app.GetPackageInfos("\", ConfigurationSettings.AppSettings("ServerIp").ToString(), "", "")

    Dim pInfo As PackageInfo

    For Each pInfo In  pInfos

      

       If pInfo.Name <> "Maintenance Plans" Then

         

          ComboBoxJob.Items.Add(pInfo.Name)

       End If

    Next pInfo

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

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

    Dim pkgResults_Sql As DTSExecResult

    Dim pkgIn As New Package()

    pkgIn = app.LoadFromSqlServer("\" + ComboBoxJob.SelectedItem.ToString().Trim(), ConfigurationSettings.AppSettings("ServerIp").ToString(), "", "", Nothing)

    pkgResults_Sql = pkgIn.Execute()

    'Message box will show either Success/Failure

    MessageBox.Show(pkgResults_Sql.ToString())

     

     

  • thanks for that I'll try saving the packages in a SQL Server instance rather than the file system and see if I can load them from there.

    I'll let you know how I go

    Regards

    Ray

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply