This brings up a vast topic of "How memory handling works in .NET".
First of all - try not to use CommandBuilder, it's not the recommended
approach unless your application is aimed to be quick and dirty.
Secondly - Dispose is thanks to IDisposable, all expensive objects must
implement dispose. Calling dispose will immediately ask the object to clean
itself. The other option is Finalize - which is well equal to the destructor
with a difference that you donot know when it will be called. It is
eventually called by the garbage collector, but you don't know when that
will happen and you cannot determine that with any degree of certainity.
Therefore, if an object exposes a dispose - call it when ur done with it.
Will not calling it result in a memory leak? It could .. though restarting
ur app will fix that to some extent and call the finalizers on each of the
objects, but thats not good either.
- Sahil Malik
Independent Consultant
You can reach me thru my blog -
http://dotnetjunkies.com/WebLog/sahilmalik/
"Ed" <an*******@discussions.microsoft.com> wrote in message
news:1c*****************************@phx.gbl...
I just learned how to use the Commandbuilder and have
researched it a little bit further and see that there is a
dispose property. Should this be used after invoking the
command builder or does vb.net cleanup after itself on its
own? If I don't use it would this lead to a memory leak?
TIA,
Ed