Close SqlConnection in the Finally when using “Using”

前端 未结 6 644
独厮守ぢ
独厮守ぢ 2020-12-21 00:06

I want to close the SqlConnection in the Finally since the using not really close it and the connection pool gets full. but I don\'t realize what\'s the right way to fo that

6条回答
  •  半阙折子戏
    2020-12-21 00:44

    As per my understanding Dispose() method of connection object will close the Connection. You don't need to call Connection.Close explicitly.

提交回复
热议问题