Implement Threading in

on Oct 30, 2012 11:49 PM

I want to implement threading in Here I want to use ThreadPool.QueueUserWorkItem() method.


ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf TaskA), AIsDone)

My Code:

ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf CType(tempControl, ReportletBase).GetReportData), Nothing)

Code block:

                    'Load the ascx control within the TD cell
                    tempControl = Me.LoadControl("~/Reportlets/" & CStr( & ".ascx")

           ---->   ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf CType(tempControl, ReportletBase).GetReportData), Nothing)

                    CType(tempControl, ReportletBase).Position = position
                    CType(tempControl, ReportletBase).ReportToBeLoadedIn = m_proxy.Report
                    reportlePlaceholder.Controls.AddAt(reportlePlaceholder.Controls.Count, tempControl)

 Catch ex As System.Exception


tempControl: variable holding references of user controls of type ReportletBase (base Class)

GetReportData(): It is main method in each user control class that inherits ReportletBase class. We want to implement multi-thread
on this method


Method 'Public MustOverride Function GetReportData() As System.Collections.Hashtable' does not have a signature compatible with delegate 'Delegate Sub WaitCallback(state As Object)'.

Here GetReportData() has return type as Hashtable - How to embedd this with delegate use in above code


Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Oct 30, 2012 11:50 PM


on Oct 31, 2012 04:09 AM

Hi Mudassar,

I already seen this article. however my requirement is bit different.

I have asyn the particular method i.e. GetReportData() of Type ReportletBase and its return is Hashtable.


How to achieve this.

on Oct 31, 2012 08:23 AM

So what you want to return?