cj,
The old C++ people want to dispose, (they want a deconstructor)
The old VB6 people want to set it to nothing (they have read that)
Because of that there are lot of tales on internet. One of them.
They did not make that method for nothing. Something if you have to use
forever all methods that exist in a class.
One of the reasons that there is managed code is to make the need of that
not direct neccesary anymore (not in all circumstances, by instance GDI uses
a lot of resources so there it is recomended because of to free the
resources).
You can use Dispose or Close. The Dispose is the same as the close with the
exception that it removes overloaded the actual connectionstring from the
object.
(The using has the dispose in it).
Cor
"cj" <cj@nospam.nospamschreef in bericht
news:OO**************@TK2MSFTNGP06.phx.gbl...
When I make a request of our sql server I Dim A New SqlConnection and I
Dim A New SqlCommand. The sqlcommand gets it's connection property set to
the sqlconnection. I've recently read the I need to dispose of the
sqlconnection after closing it. Shouldn't I then also dispose of the
sqlcommand???? Both have dispose methods.