"Kalpesh" <sh*********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Miha,
Good to hear from an expert. I read your blog :)
:-)
So, if I am using DataTable etc in my code (not dropped using the
designer), I must dispose it
Right ?
Sort of. IDisposable is a contract that mean call Dispose when done with the
instance and you are safe if you do.
However, some people might argue that Dispose does nothing on certain
classes such as DataTable which might even be true at the present time. Yet
the implementation of Dispose might change for such a class in the future -
imagine that Dispose actually does something important in .net 3 version of
DataTable and your program will have problems if it doesn't call it.
The bottom line is: if you want to be on the safe side always call Dispose
if class implements IDisposable.
--
Miha Markic [MVP C#]
RightHand .NET consulting & development
www.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/