1.You must use constants values from the same type as your properties from
Timesheets
entity class are expected to be;
2.So you have to look on the generated source code of your
Timesheets
class for the property
projectid
, and if its type is
string
you should use string values in your code like in the next example:
IEnumerable<timesheet> list = from v in context.Timesheets
where v.projectid = "5"
select v;
</timesheet>
3.Based on the info that your
projectid
is an int you should change your code like this:
public void upd()
{
amritEntities amritEntities context = new amritEntities()
IQueryable<timesheet> list = from v in context.Timesheets
where v.projectid = 5
select v;
List<timesheet> resultList = list.ToList();
foreach (timesheet item in resultList )
{
item.projectid = 7;
}
context.SaveChanges();
}
}