Miha,
I have thought a little bit of that disposing question of the connection.
(AFAIK is this is not earlier written in this newsgroup) so I am ready for a
discussion with guys as you.
I think that it is good to use the "close" of a connection at by instance by
the designer created connection.
The advance is that by the designer is created a global "new" connection
object and therefore you have only to open and to close it, while otherwise
you will have to create every time over the already global existing object
address placeholder a new object. Every disposing even if you doubt is done
by the by the form or component automaticly created Idisposable
implementation in that class.
If you do it by hand and you don't set the connection object globaly (The
last I never do), than using dispose instead of the close gives the
behaviour as you told. If you than have the slightest idea that it will not
be disposed, than that does not harm very much (it removes the connection
strings in advance that it is collected by the GC and gives the GC the sign
that it is ready to collect.
Although I have not the idea that this will improve much, because as I
thought that I have read here from Bill Vaughn and X does is the close
already remove the connection from the pool (If somebody as Bill or Marina
or somebody else who has tested this cofirm or deny this behaviour. If not
than I will test this once in future).
If you use the connection object by hand globaly, than it has in my idea not
much sence to dispose, I have not readed that it will be set to nothing by
the dispose and therefore it keeps its reference. Therefore it will keeps
its reference and only be released by the GC if a new object is created
using that placeholder for that address or the program finishes.
Shoot
)
Cor
PS. X is a Microsoft guy with a for me Spanish sounding name, however it
seems that my brain has with those names a problem to remember them. As with
most names however with those especially (except Angel).