locked
Parallel.ForEach not running properly RRS feed

  • Question

  • User-1516191262 posted

    I am using Parallel.ForEach for processing 60  file for 900 customers.

    Not all customers are processed with <g class="gr_ gr_87 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="87" data-gr-id="87">parrallel</g> code

    Parallel.ForEach(DsCID.Tables[0].AsEnumerable(), row =>
    {
    string cids = row[2].ToString();  //customer id


    fileone(cids);
    filetwo(cids);
    //ect for 60 files

     }

    code not run for all customers please help

    Tuesday, November 27, 2018 10:09 AM

All replies

  • User283571144 posted

    Hi swagatraorane1986,

    According to your description, I couldn't directly find out the reason about why all customers are processed with parrallel code.

    Could you please tell me how you call these codes? From a asp.net webform code-behind or MVC controller?

    What you mean about  all customers are processed with parrallel code?  Do you mean you find the codes is not running?

    Is there any error message is thrown by your program?

    If you could post more details information, it will be more easily for us to understand your issue and find out the solution.

    Best Regards,

    Brando

    Wednesday, November 28, 2018 5:27 AM
  • User-1516191262 posted

    <g class="gr_ gr_50 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="50" data-gr-id="50">Thanks</g> <g class="gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="5" data-gr-id="5">brando</g>,

    <g class="gr_ gr_152 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="152" data-gr-id="152">its</g> console application. We have customedata in one table. we are hitting multiple <g class="gr_ gr_166 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="166" data-gr-id="166">adwords</g> API <g class="gr_ gr_276 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="276" data-gr-id="276">request  for</g> each customer and storing data in <g class="gr_ gr_273 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="273" data-gr-id="273">database</g>.

    I am logging each hit in a text file. There <g class="gr_ gr_335 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="335" data-gr-id="335">is no error neither</g> log for some customer.

    Wednesday, November 28, 2018 8:50 AM
  • User283571144 posted

    Hi swagatraorane1986,

    According to your description, I still couldn't find the reason.

    Could you please post the details codes for us to reproduce this issue.

    Besides, our forum is mainly talking about asp.net related issue, you requestion is related with C#, I suggest you could post in below forum.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral 

    Best Regards,

    Brando

    Monday, December 3, 2018 2:00 AM