2 u013741736 u013741736 于 2014.02.22 19:46 提问

错误 1 无法对属性或索引器“AnonymousType#1.EmployeeId”赋值 -- 它是只读的

var temp = db.UseVihicle.Where(x => x.Id == Id).Select(a => new { a.EmployeeId, a.VihicleId, a.StartTime, a.EndTime, a.Description, a.Destination, a.Cause, a.Status });
foreach (var x in temp)
{
x.EmployeeId = emp_id;
x.VihicleId = vih_id;
x.StartTime = DateTime.Parse(StartTime);
x.EndTime = DateTime.Parse(EndTime);
x.Destination = Destination;
x.Cause = Cause;
x.Description = Description;
x.Status = 3;
}
db.SubmitChanges();

1个回答

u013741807
u013741807   2014.02.22 20:02

错误 X.CFJIEJDLKDFOECMLSLL

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!