What happend with objects after ...

Madz

Centurion
Joined
Jan 22, 2003
Messages
155
I want to Ask you one thing

When we define some new object such as connection object or some sql command with in a procedure or sub

what happend to them after the function is over ? such as after Exit sub

are they remain in the memory or they are disposed off automatically ?
 
They are disposed of, but there is no guarantee that the memory will be freed right away. There should be no problem with memory.

Also, if only for code readability, you should close all connections explicitly. I would tend to let .NET do as little automatically as possible (within reason, of course).
 
Back
Top