I don't understand delegates, but I got some help a while back and was able to make it work. Now I have a new project and I did something to break it.
I have a Background Worker that has an object that's doing SqlBulkCopy. I have this line.
In my main form I have a sub for updating a TextBox.vb.net Code:
AddHandler bcMain.SqlRowsCopied, New SqlRowsCopiedEventHandler(AddressOf frmMain.OnSqlRowsCopied)
This works for everything except the SqlBulkCopy reporting rows copied. The odd thing is when I run the debugger and break on the AppendText line, I can see it doing it, but it's not apparent on the main form. I've tried adding a Refresh() on the control and the form, but it doesn't work. What am I doing wrong?vb.net Code:
Private Delegate Sub AppendResultsDelegate(strMessage As String) Private Sub AppendResults(strLine As String) txtResults.AppendText(strLine & vbCrLf) End Sub




Reply With Quote
