Parallel.Foreach SQL querying sometimes results in Connection

后端 未结 3 862
暖寄归人
暖寄归人 2021-01-01 04:37

I need to speed up performing 12 queries in my application. I switched from a regular foreach to Parallel.ForEach. But sometimes I get an error saying \"ExecuteReader requ

3条回答
  •  生来不讨喜
    2021-01-01 05:07

    You can also use MultipleActiveResultSets=true; in connection string to support multiple readers

提交回复
热议问题