We help IT Professionals succeed at work.
Get Started

Multiple Threads using Active Reports

372 Views
Last Modified: 2012-05-09
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)
            conn.Open()
            Dim ds As New DataSet
            Dim da As New OleDb.OleDbDataAdapter(strSelect, conn)
            da.Fill(ds, "Detail")
            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?  
Comment
Watch Question
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE