I have created a web part in visual studio, it deploys fine, but when I try to add it to a page I get the following error:
Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))
I read that this could happen due to disposing of objects too soon, so I changed
using (SPSite site = SPContext.Current.Site)
to this
using (SPSite site = new SPSite(SPContext.Current.Site.Url))
but it didn't fix anything. Does anyone have any idea why this would happen?
UPDATE:
I'm not using SPWeb but I use the SPSite object here:
using (FullTextSqlQuery fullTextSqlQuery = new FullTextSqlQuery(site))
