Disposing SharePoint Objects
Yes. It's completely fine.
If you can use like below code in using block:
using(SPSite oSPsite = new SPSite("http://server"))
{
using(SPWeb oSPWeb = oSPSite.OpenWeb())
{
str = oSPWeb.Title;
str = oSPWeb.Url;
}
}
web.Dispose();
site.Dispose();
No comments:
Post a Comment