Error “There is already an open DataReader associated with this Command which must be closed first” when using 2 distinct commands

后端 未结 7 1718
春和景丽
春和景丽 2020-11-29 01:23

I have this legacy code :

 private void conecta()
 {  
     if (conexao.State == ConnectionState.Closed)
         conexao.Open();
 }

 public List

        
7条回答
  •  既然无缘
    2020-11-29 02:01

    Add MultipleActiveResultSets=true to the provider part of your connection string. See the example below:

    
    

提交回复
热议问题