What is meant by connection.Dispose() in C#?

后端 未结 4 2055
粉色の甜心
粉色の甜心 2021-01-12 10:09

What is meant by connection.Dispose() in C#?

4条回答
  •  悲&欢浪女
    2021-01-12 10:29

    Generally Dispose is called to free resources when you are finished using the component.

    The Dispose method on a SqlClientConnection object will force the connection to close.

    It is a common pattern that can be found not just in .Net but Java too.

    MSDN should provide all the documentation you need on the correct way to call Dispose

提交回复
热议问题