I'm trying to do a simple update but I cannae for the life of me work out what I am doing wrong.
I have the following code which currently is not working - I'm getting not all code paths return a value.
public List<tblWeight> UpdateFeedback(string memberid, string locationid, int prikey, string feedback)
{
MyEntities updatefeedback = new MyEntities();
tblWeight newfeedback = (from q in updatefeedback.tblWeights
where q.MemberId == memberid &&
q.LocationId == locationid &&
q.PriKey == prikey
select q).SingleOrDefault();
updatefeedback.tblWeights.AddObject(newfeedback);
updatefeedback.SaveChanges();
}
Basically, I am attempting to update the Feedback column within tblWeight based upon the where clauses.
Can anyone point out where I am going wrong...drastically!!
- Sorry - the previous try/catch was legacy.