BeginExecuteNonQuery without EndExecuteNonQuery

后端 未结 5 1445
梦谈多话
梦谈多话 2020-12-03 10:40

I have the following code:

using (SqlConnection sqlConnection = new SqlConnection(\"blahblah;Asynchronous Processing=true;\")
{
    using (SqlCommand command         


        
5条回答
  •  难免孤独
    2020-12-03 11:18

    You should always call the EndExecuteNonQuery() method to prevent leaks. It may work now but who knows what will happen in future versions of .NET. The general rule is always follow a BeginExecute... with an EndExecute...

提交回复
热议问题