开发者

Convert For Each GridViewRow to Parallel.ForEach GridViewRow

开发者 https://www.devze.com 2023-02-11 12:23 出处:网络
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?

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))

0

精彩评论

暂无评论...
验证码 换一张
取 消