我无法使用新的LINQ功能更新SharePoint 2010中的记录。
下面是我的代码,请检查一下。
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";
ctx.Holidays.Attach(Holidayobj);
// or ctx.Holidays.Attach(Holidayobj, true); not working in 2010
ctx.SubmitChanges();
}