Trouble writing SSID events to a text box

Ryan1

Member
Joined
Aug 18, 2013
Messages
8
Programming Experience
Beginner
I am currently working on an SSID caller type visual basic program. It executes .dtsx packages from the VB.Net shell. I have all of the code up and running however I cannot seem to write my eventlistener information to a textbox while the .dtsx packages are running. The package will complete it's full execution than all of the data will load to the textbox at once.

-Messageboxes will popup if I put them in the Subs/Functions of EventListener (or the in the StringAppender function you see below) but data will not write to the textbox at that time.
-The stringAppender function that you see in each Sub/Function below basically just writes each input string to an array. I then have a for loop which cycles through the array and writes to the textbox in a different part of the program. I originally tried to write to the textbox in StringAppender but there was no luck.


VB.NET:
   Public Class EventListener
        Inherits DefaultEvents
        Public Overrides Sub OnExecutionStatusChanged(exec As Microsoft.SqlServer.Dts.Runtime.Executable, _
                                                      newStatus As Microsoft.SqlServer.Dts.Runtime.DTSExecStatus, ByRef fireAgain As Boolean)
            Dim information As String = ("information As : " & newStatus & " " & " " & fireAgain)
            StringAppender(information)
        End Sub
        Public Overrides Sub OnProgress(taskHost As Microsoft.SqlServer.Dts.Runtime.TaskHost, progressDescription As String, _
                                          percentComplete As Integer, progressCountLow As Integer, progressCountHigh As Integer, _
                                          subComponent As String, ByRef fireAgain As Boolean)
            Dim progressReport As String = ("Progress: " & vbCrLf & progressDescription & " percentComplete " & percentComplete & _
                                            " ProgressCount Low " & progressCountLow & " ProgressCountHigh " & progressCountHigh & vbCrLf)
            StringAppender(progressReport)
        End Sub

        Public Overrides Function OnError(ByVal source As Microsoft.SqlServer.Dts.Runtime.DtsObject, _
          ByVal errorCode As Integer, ByVal subComponent As String, ByVal description As String, _
          ByVal helpFile As String, ByVal helpContext As Integer, _
          ByVal idofInterfaceWithError As String) As Boolean
            Dim eventErrors As String = ("Errors in: " & vbCrLf & " " & subComponent & " " & description)
            StringAppender(eventErrors)
            Return True

        End Function
        Public Overrides Sub OnWarning(source As Microsoft.SqlServer.Dts.Runtime.DtsObject, warningCode As Integer, _
                                         subComponent As String, description As String, helpFile As String, helpContext As Integer, _
                                         idofInterfaceWithError As String)
            Dim eventWarnings As String = ("Warnings in:" & vbCrLf & subComponent & " " & description)
            StringAppender(eventWarnings)
        End Sub
    End Class
End Module

Thanks for the help.
 
Presumably everything is happening on the same thread, so painting the UI is deferred while other processing is performed. You can either call Application.DoEvents to allow all pending events, including Paint, to be processed or else you can call the Refresh method of the control you want to update to force a Paint event to be raised and handled on that control.
 
Back
Top