这是我的代码:
static AogStatus status;
private void loadData()//Called if Page.IsPostback=false
{
status = (from sta in dbContext.AogStatus
where sta.AOGStatus_Id == i_status_id
select sta).Single();
}
protected void UpdateButton_Click(object sender, EventArgs e)
{
status.Aircraft_Id = Int32.Parse(acReg.SelectedValue);
status.Airport_Id = Int32.Parse(Station.SelectedValue);
status.CreationDate = DateTime.Now;
dbContext.SaveChanges();
}
单击“更新”按钮时,它不会保存更改。它没有抛出异常。我正在使用EF 4.3.1 ..我无法弄清楚是什么问题..任何想法?感谢...