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.

Comments

Popular

C# 6.0 New Features

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX

What is Cloud Computing - A guide for beginners