var m = new DostaffContext(); sd.name = "aa"; sd.phone = "bb";
m.SubmitChanges();
这个修改怎么只在页面上更新了,但是没有把数据库的更新了,是怎么回事呢?请高人指点
------解决方案--------------------
C# code
StaffTable sd = (StaffTable)this.StaffData.SelectedItem;
var m = new DostaffContext();
var newSd=m.StaffTable.SingleOrDefault(t=>t.ID==sd.ID);
newSd.name = "aa";
newSd.phone = "bb";
m.SubmitChanges();