Close SqlConnection in the Finally when using “Using”

前端 未结 6 649
独厮守ぢ
独厮守ぢ 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 01:03

    The way you are closing the connection with Using is Ok. Perhaps you might have forgotten to close some DataReaders instead ?

提交回复
热议问题