Wednesday, 21 September 2016

Dispose vs Close

In this blog, we will see the differences between Dispose() and Close()

What are the differences between Dispose() and Close()

Dispose() and Close() function for is used to dispose or close SharePoint server objects like SPWeb, SPSite. Purpose of these 2 methods is same.

So which one is better to use?

It is better to call Dispose() instead of Close() why because server objects like SPWeb and SPSite implements the IDisposable interface and standard .Net framework GC calls the Dispose method.

No comments:

Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks