Getting “The connection does not support MultipleActiveResultSets” in a ForEach with async-await

前端 未结 4 1262
遥遥无期
遥遥无期 2021-01-03 21:42

I have the following code using Dapper.SimpleCRUD :

var test = new FallEnvironmentalCondition[] {
    new FallEnvironmentalCondition {Id=40,FallId=3,Environm         


        
4条回答
  •  醉酒成梦
    2021-01-03 22:19

    You need to add attribute MultipleActiveResultSets in connection string and set it to true to allow multiple active result sets.

     "Data Source=MSSQL1;" & _  
        "Initial Catalog=AdventureWorks;Integrated Security=SSPI;" & _  
        "MultipleActiveResultSets=True"  
    

    Read more at: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/enabling-multiple-active-result-sets

提交回复
热议问题