Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the Diff between dispose() and close() ?
Posted

They do different things. Do you not have google or own a VB book ? Dispose is an interface for anything that has resources that need to be freed, it frees them right away instead of when GC occurs (which may be never). Close closes an object. there is no reason to assume that every method that has one method, has the other. It's fair to say that if you read the documentation for the object you're using, it would explain this.
 
Share this answer
 
Comments
Christian Graus 24-Jul-12 0:40am    
The solution you marked as the answer, has three links that explain the answer. I bet a simple google is how he found them.
The basic difference between Close() and Dispose() is,

when a Close() method is called, any managed resource can be temporarily closed and can be opened once again.
It means that, with the same object the resource can be reopened or used.

Where as Dispose() method permanently removes any resource ((un)managed) from memory for cleanup and the resource no longer exists for any further processing.
Ref.:Close() & Dispose()[^]

Have a look:
.Close() vs .Dispose() which difference[^]
IDisposable.Dispose Method[^]
When and How to Use Dispose[^]
 
Share this answer
 
Comments
ianshack 24-Jul-12 0:34am    
thank you sir.
Prasad_Kulkarni 24-Jul-12 0:38am    
Glad it helps!
You're welcome..
_Amy 24-Jul-12 0:36am    
Nice Answer. +5!
Prasad_Kulkarni 24-Jul-12 0:38am    
Thank you Amit!
 
Share this answer
 

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