MultiThreading error: There is already an open DataReader associated with this Connection which must be closed first

后端 未结 2 1097
时光取名叫无心
时光取名叫无心 2021-01-12 21:39

I have a Parallel.Foreach loop

var options = new ParallelOptions();
options.MaxDegreeOfParallelism = 1;
Parallel.ForEach(urlTable.AsEnumerable(),drow =>
{         


        
2条回答
  •  长发绾君心
    2021-01-12 22:10

    You're using the same connection at the same time.

    Do you have several thread ? Because it seems that 2 threads use the same connection to concurrently make a call.

提交回复
热议问题