How to run multiple SQL commands in a single SQL connection?

前端 未结 9 1014
野的像风
野的像风 2020-11-27 15:03

I am creating a project in which I need to run 2-3 SQL commands in a single SQL connection. Here is the code I have written:

SqlConnection con = new SqlConn         


        
9条回答
  •  臣服心动
    2020-11-27 16:03

    Just enable this property in your connection string:

    sqb.MultipleActiveResultSets = true;

    This property allows one open connection for multiple datareaders.

提交回复
热议问题