I am really confused about why an update is not taking place. This is very simple:
int goodID = 100; DataContext db = new DataContext(); Schedule schedule = db.Schedules.Single(s => s.ID == goodID); // this wont persist - WHY NOT?! schedule.Email = txtEmail.Text; // this does persist schedule.NumberCourses = 5; db.SubmitChanges();
I can’t understand why the field, Email, isn’t getting the value from the textbox. What can I check?
EDIT
I have set a breakpoint and checked the value after assignment. It assigns the textbox value but still no update.
I am an idiot. It’s fixed. Votes for everyone. Instead of checking in the database, like a normal person would, I was just looking on the webform after refreshing the page. I wasn’t initializing the textbox with the value from the db. So the update was happening. See? I told you I was an idiot.