Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected override void Dispose(bool disposing)
       {
           if (disposing && (components != null))
           {
               components.Dispose();
           }
           base.Dispose(disposing);
       }
Posted
Updated 3-Jun-11 22:39pm
v2

hi,,

Use this method to close or release unmanaged resources such as files, streams, and handles held by an instance of the class that implements this interface. By convention, this method is used for all tasks associated with freeing resources held by an object, or preparing an object for reuse.

http://www.hitxp.com/comp/pro/cs/220705.htm[^]

refer that link

this will help
 
Share this answer
 
Comments
Smithers-Jones 4-Jun-11 5:41am    
You don't have to post every comment twice. I removed the copies.
Ragi Gopi 4-Jun-11 5:42am    
can u plz help me
Disposing the used resources. It frees the resources from memory. Read the below one.

Tull Clancey Points out that other objects may need to be cleaned up as well. He writes:

...file handles, database controls, database objects, recordset objects, forms, and any other active links should be closed within a Form_Unload(x) procedure. If not done any links made will still be valid when the application is ended.

This is not always the case for the data control, however it is always good practice to close what you have opened. Mother always said put yesterdays toys away before playing with those today, very good advise!

An excellent point! While worrying about form closing problems, one shouldn't forget the basics.
Clickety[^]
 
Share this answer
 
Comments
Espen Harlinn 5-Jun-11 5:55am    
Nice reply, my 5
Exact use of Dispose methord

Use this method to close or release unmanaged resources such as files, streams, and handles held by an instance of the class

this link will help you :)

When, How, Where and Why to use Dispose[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900