what is the difference between dispose and clear? [Resolved]

Posted by Hariinakoti under C# on 12/5/2012 | Points: 10 | Views : 4875 | Status : [Member] | Replies : 3
Hi All,
What is the difference between dispose and clear?

Thanks & Regards
Hari



Responses

Posted by: Sandhyab on: 12/5/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,
The Clear is used at the end of the program, to remove all items from object.
Dispose() method permanently removes any resource managed from memory for cleanup and the resource no longer exists for any further processing.We can implement a Dispose method to explicitly deallocate resources.

Thanks & Regards

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

Posted by: Vuyiswamb on: 12/5/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
In What context and regarding which control ?


Clear = "Clear the contents of the Control or Object"

Dispose = remove the Object , if you try to access it you might get an error
 "object not set for an instance of an object"



Thank you for posting at Dotnetfunda
[Administrator]

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

Posted by: Rajesh081725 on: 12/7/2012 [Member] Bronze | Points: 25

Up
0
Down
Nice

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

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

Login to post response