A
alx
On some documentation about ADO.NET, I've found that, during the close
of a IDbConnection, is a "best practice" to close a connection with
these lines of code:
connection.Close();
connection.Dispose();
For example, Microsoft Data Access Application Block uses this code to
close connection. Also they call Dispose method for others ADO.NET
objects (Command, DataAdapter).
I'd like to know if it's really necessary to close a Connection always
with this 2 lines of code and call Dispose method for Command or
DataAdapter objects.
Thanks.
of a IDbConnection, is a "best practice" to close a connection with
these lines of code:
connection.Close();
connection.Dispose();
For example, Microsoft Data Access Application Block uses this code to
close connection. Also they call Dispose method for others ADO.NET
objects (Command, DataAdapter).
I'd like to know if it's really necessary to close a Connection always
with this 2 lines of code and call Dispose method for Command or
DataAdapter objects.
Thanks.