I made a database of a school which contains a bunch of values and I'm trying to make an update function in the program I'm making , whenever I save the changes in the server it gives an Exception, here is a code sample of which how I update the row locally:
var query =
from s in db.Students
where s.StudentID == querierID
select s;
foreach (Student s in query)
{
s.FirstName = fntb.Text;
s.LastName = lntb.Text;
s.Mobile = mobiletb.Text;
s.Street = streettb.Text;
}
And here is how I Actually save to the database(Send the updated row to it)
db.SaveChanges();