I am using dynamic SQL (put into strSelect in my program) to fill an ActiveReports report. This is the code I use to set the datasource for the report (ActiveReports requires using OleDb in this case) :
'set up connection string and dataset
Dim connString As String = "Provider=SQLOLEDB.1;" & myConnectionString
Dim conn As New OleDb.OleDbConnection(connString)
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter(strSelect, conn)
rpt.DataSource = ds
rpt.DataMember = "Detail"
The problem is that the fill can take a long time if there’s a lot of data and the user can’t do anything else. I would like to run fill in a separate thread, but I would have to know when it is finished, so I can run the report. The events I see for OleDbDataAdapter don’t seem to include one for fill completed. Do you know of any other way I can prevent the fill process from locking up the machine?