Well, there really is more to it than that. By default, the connection
pooling is on. The default behavior of close flags the connection object
as reusable and returns it to the connection pool. After 60 seconds
(default timeout), the connection is truly closed. A closed connection may
then have the managed memory reclaimed. So either call has the same effect
underneath as rightly pointed out.
--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @
http://www.lulu.com/owc
----------------------------------------------------------
Tod Birdsall said:
Hi Antonio,
If you view the SqlConnection Dispose() method using a disassembler (I
use .NET Reflector) you will see that all it does is check to see if
the ConnectionState is open and if it is, it calls the Close() method.
So, to answer your question, if you call Close() yourself, there is no
need to call the Dispose() method.
Tod Birdsall, MCP
http://tod1d.blogspot.com