Enumerate a DataGridView using Parallel.ForEach

Locked Enumerate a DataGridView using Parallel.ForEach

  • Dienstag, 3. Mai 2011 20:34
     
     

    I have a datagridview with details of sites that I need to poll.  I would like to enumerate this list using parallel processing to perform a set of actions for each site, but can't figure out the syntax beyond parallel.foreach.  Can anyone help me with the parallel.foreach structure when referencing a datagrid?

     

    Thanks!

    • Verschoben Helen Zhou Donnerstag, 5. Mai 2011 02:21 (From:Windows Forms Data Controls and Databinding)
    •  

Alle Antworten

  • Dienstag, 3. Mai 2011 23:11
     
     
    what is the data gird's data source? you may want to work on the data source instead.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
  • Mittwoch, 4. Mai 2011 14:13
     
     

    The datagrid source is a single simple Oracle table.  Not sure how to use that either???

  • Mittwoch, 4. Mai 2011 19:14
     
     
    You mean a datatable? If so you can use DataRow as the source type.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
  • Donnerstag, 5. Mai 2011 02:20
     
     

    Hi mtnrnrchic,

    Parallel programming is not supported in this forum, we have Parallel Computing Forums dedicated to this kind of question, please post it there to get better help.

    Also, may be following MSDN documentation would be some of help:
    How to: Write a Simple Parallel.ForEach Loop
    Data Parallelism (Task Parallel Library)
    Parallel Programming in the .NET Framework
    C# - How to convert Foreach loop to Linq (in datagridview)

    Sincerely,


    Helen Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.