将每个GridViewRow转换为Parallel.ForEach GridViewRow

时间:2011-02-17 18:07:38

标签: vb.net parallel-processing

我正在尝试将下面的代码转换为并行循环。使用Parallel.ForEach而不仅仅是ForEach的正确语法是什么?

    For Each grow As GridViewRow In gvEmployees.Rows
        SendSummaryReport(grow)
    Next

2 个答案:

答案 0 :(得分:1)

这是我以前的工作方式:

 Parallel.ForEach(Of GridViewRow)(gvEmployees.Rows.OfType(Of GridViewRow)(), (AddressOf SendSummaryReport))

答案 1 :(得分:0)

你想要做

Parallel.ForEach(Of GridViewRows)(gbEmployees.Row, Function(grow) SendSummaryReport(grow))