Cylix,
Close makes it possible for the SQLServer to remove the connection from the
connection pooling.
Dispose is removing as extra the reference to the connectionstring in the
connection object. The same as
setting before the close the XXXconnection.connectionstring to nothing.
Dispose is calling Close before that and therefore has for the
connectionpooling the same effect. AFAIK is that connectionstring the only
reference that can prevent it from being garbaged and therefore this will be
done.
Setting it to nothing has sense if you have set your connection globally
because than the reference to that will be cleaned and the last one can be
garbaged, in other cases it is without sense. Declaring it globaly is by
instance the way as versions 2002/2003 do it using the wizards. I would try
to prevent that.
I hope this gives an idea,
Cor
"Cylix" <cy*******@gmail.comschreef in bericht
news:11*********************@m79g2000cwm.googlegro ups.com...
Does anyone can explain the details between
Connection.close
Connection.dispose
Connection = nothing
If I just need to close the connection and release the memory,
do I need to write all three statement?
Thank you.