Tagged Questions
6
votes
2answers
226 views
Is it bad to dispose an object twice?
With all the focus on disposing all disposable objects in SharePoint, I wondered if there is any harm in disposing an object twice. Especially since SharePoint seems to do some disposing itself too. ...
2
votes
3answers
127 views
4 using statements looks messy? Any suggestions on what is a better way to code this?
Imagine the following code:
using (SPSite spSite = new SPSite(this.SiteURL))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
using (SPSite spSite2 = new SPSite(this.SiteURL2))
{
...
2
votes
1answer
713 views
Disposing of objects in an Event Receiver
I have an ItemUpdated event receiver running on a library. Some pretty basic logic. Here's the gist of what I'm doing:
SPWeb web = properties.Web;
SPContentTypeId ParentCT_Id = ...