Thanks for responding. Since setting the object to null can make it applicable for garbage collection,what happens to the resources held by that object?Can we assume that the resources will be freed once we set the objcet to null?If thats the case,then i really dont need to close the database connection(I understand that closing the db connection is a best practice). Sorry if these questions sound stupid.
In order to free external resources used by your object ASAP, you should implement IDisposable interface in your class. More info here:
http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx
Vitaliy Liptchinsky
http://dotnetframeworkplanet.blogspot.com/