Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have 2 calender list Name A and B. when i delete items from list A, it should delete item from list B. List A items get deleted successfully but list B items throws SpException. but when i again run the program, it successfully deletes the items from B too. what can be the issue?. I am using DisabledItemEventsScope while deleting.

share|improve this question
    
Can you post here the exception? Code snippet would be also useful. –  luccio Jul 25 at 7:34
1  
i solved it. i was not disposing web object. thanks anyways –  SharePointer Jul 25 at 7:39

1 Answer 1

up vote 1 down vote accepted

use this after listname.DeleteItemById

 SPWeb web = SPContext.Current.Web;
 web.Dispose();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.