Thing to take care when closing application

Posted by Thiru under VB.NET on 3/27/2012 | Points: 10 | Views : 749 | Status : [Member] | Replies : 2
Hi,
while developing windows application
we generally use: dbconnection, adapter,dataset, public variable etc....
and we close the connection immediately after use.

and i do: command.Dispose and adapter.Dispose too once after the connection is closed.

now i like to know what else i have to follow to clear memory
during the application runtime and while closing the entire application (Exit from app.)

regards,
Thiru.




Responses

Posted by: Savariya on: 3/27/2012 [Member] Starter | Points: 25

Up
0
Down
use this at the end of closing application code
GC.SuppressFinalize()

this will call GC to clean up the objects which are still there in memory

Thanks
Chintan

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 3/27/2012 [Member] Bronze | Points: 25

Up
0
Down
you can override dispose method of IDisposable interface and use GC.SuppressFinalize() in dispose method.


Thanks,
Rajni Shekhar

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response