Posted on: 10/31/2012 1:42:24 AM | Views : 208

I want to implement threading in VB.net. Here I want to use ThreadPool.QueueUserWorkItem() method.
Example:
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf TaskA), AIsDone)
My Code: ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf CType(tempControl, ReportletBase).GetReportData), Nothing)
Code block:
Try
 tempControl = Me.LoadControl("~/Reportlets/" & CStr(reportlet.id) & ".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
Description:
tempControl: variable holding references of user controls of type ReportletBase (base Class) GetReportData(): It is main method in ...

Go to the complete details ...