re:
> As Bruce said, close it. Don't dispose it.
Interesting point for discussion, Kevin.
There's a question as to the *unmanaged* resources which need freeing,
over and above the need for freeing the *managed* .net resources.
See Rocky Lhotka's article :
http://www.lhotka.net/WeBlog/Dispose...ndObjects.aspx
"However, it also turns out that some Command objects really do have non-managed
resources that need to be disposed. Some don't. How do you know which do and
which don't? You need to ask the dev that wrote the code.
It turns out that SqlCommand has no un-managed resources, which is why most of us
have gotten away with this so far. However, OleDbCommand and OdbcCommand
do have un-managed resources and must be disposed to be safe."
Comments ?
btw, I just finished a fix for a client's application, developed by someone else,
and for which I was brought in as trouble-shooter, which was having resource problems.
It had 117 undisposed of OleDbCommand objects.
I disposed all of them...and the problem vanished.
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en espaņol :
http://asp.net.do/foros/
===================================
"Kevin Spencer" <> wrote in message
news:...
> As Bruce said, close it. Don't dispose it.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
>
> Show me your certification without works,
> and I'll show my certification
> *by* my works.
>
> "bannaman" <> wrote in message
> news: ups.com...
>> Sorry the dim sqlconn as sqlconnection = dbconnection() was a typo it
>> should have been dim db as sqlconnection = dbconnection().
>>
>> As i am creating a connection in another function and passing it back
>> to my routine does it still close the conneciton that was opened when
>> calling dbconnection. do i not need to do dbconnection.close or will
>> db.close be enough?
>>
>
>