Convert For Each GridViewRow to Parallel.ForEach GridViewRow
I am trying to convert the code below into a parallel loop. What is the proper syntax to use Parallel.ForEach instead of just ForEach?
For Each grow As GridViewRow In gvEmployees.Rows
SendSu开发者_运维技巧mmaryReport(grow)
Next
This is what I used to get it working:
Parallel.ForEach(Of GridViewRow)(gvEmployees.Rows.OfType(Of GridViewRow)(), (AddressOf SendSummaryReport))
You will want to do
Parallel.ForEach(Of GridViewRows)(gbEmployees.Row, Function(grow) SendSummaryReport(grow))
精彩评论