SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am unable to update the record in SharePoint 2010 using new linq feature. follwoing in my code please review it.

 AbsentTrackingSystemEntitiesDataContext ctx = new AbsentTrackingSystemEntitiesDataContext(spWeb.Url); 
            ctx.ObjectTrackingEnabled = true; 
            HolidaysItem Holidayobj = GetHolidays(HolidayID, ctx); // get the specific record to be update. 
            if (Holidayobj != null) 
                Holidayobj.Title = "test"; 
                Holidayobj.HolidayDate = DateTime.Today; 
                Holidayobj.Description = "test holiday";    
                // or ctx.Holidays.Attach(Holidayobj, true); not working in 2010 
share|improve this question
up vote 1 down vote accepted

If your GetHolidays method retrieves the item using the context, you shouldn't need to call Attach, simply update changes.

Also, are you sure you have permission to update the list? LINQ to SharePoint is still subject to the item permissions.

share|improve this answer

Your Answer


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.