What is the difference between Close and Dispose?
There is one major difference between calling the Close and Dispose methods on database connections. Close leaves the connection in a closed state; but, it is reusable—all properties, etc. can be accessed and Open can be called. On the other hand, after calling Dispose on a database connection—as with any object—, the connection object can no longer be accessed.
However, calling Dispose does not remove the connection from the connection pool.
Visual C# Best Practice
Only call the Close method on a Stream or a database connection if the object will be reused. Otherwise, use the Dispose method.
The Dispose method may be called on any instance of any type implementing the IDisposable interface. This is supported by the C# using statement which makes calling Dispose automatically easy.
Click[
^]