title: Store update, insert, or delete statement affected an unexpected number of rows (0).
body: <p>i'm quite new to MVC. I was retrieved the value from database and show it in view, and i want to made changes and updated existing value. There is no problem on retrieved value, but when i create save, it returns the error at the db.changes line:</p>
  
  <blockquote>
    <p>Store update, insert, or delete statement affected an unexpected
    number of rows (0). Entities may have been modified or deleted since
    entities were loaded. Refresh ObjectStateManager entries.</p>
  </blockquote>
  
  <p>I have try everything which is include the @Html.HiddenFor(m => m.Question_ID) in the Edit.cshtml but still no luck.</p>
  
  <p>My CreateQuestionViewModel:</p>
  
  <pre><code>public class CreateQuestionViewModel
      {
          [HiddenInput(DisplayValue = false)]
          public int Question_ID { get; set; }
  
          [HiddenInput(DisplayValue=false)]
          public int Survey_ID { get; set; }
  
          [DisplayName("Question Title")]
          public string Qext_Text { get; set; }
  
          [DisplayName("Question Type")]
          public string Question_Type { get; set; }
  
          public bool Mandatory { get; set; }
  
          public string Language { get; set; }
      }
  }
  </code></pre>
  
  <p>My Edit Controller:</p>
  
  <pre><code>  [HttpGet]
              public ActionResult Edit(int Question_ID = 0)
              {
                  var viewModel = new CreateQuestionViewModel();
                  viewModel.Question_ID = Question_ID;
  
                  if (ModelState.IsValid)
                  {
                      SURV_Question_Model surv_question_model = db.SURV_Question_Model.Find(Question_ID);
                      viewModel.Mandatory = surv_question_model.Question_Mandatory; 
                      viewModel.Question_Type = surv_question_model.Question_Type;
  
                      SURV_Question_Ext_Model surv_question_ext_model = db.SURV_Question_Ext_Model.FirstOrDefault(x =&gt; x.Qext_Question_ID.Equals(Question_ID));
                      viewModel.Qext_Text = surv_question_ext_model.Qext_Text;
                      viewModel.Language= surv_question_ext_model.Qext_Language;
  
                  }
                  return View(viewModel);
              }
  
          [HttpPost]
                  public ActionResult Edit(CreateQuestionViewModel viewModel)
                  {
                      if (ModelState.IsValid)
                      {
                          var question = new SURV_Question_Model();
                          question.Question_Mandatory = viewModel.Mandatory;
                          question.Question_Type = viewModel.Question_Type;
  
                          db.Entry(question).State = EntityState.Modified;
                          db.SaveChanges();
  
                          var question_ext = new SURV_Question_Ext_Model();
                          question_ext.Qext_Text = viewModel.Qext_Text;
                          question_ext.Qext_Language = viewModel.Language;
  
                          db.Entry(question_ext).State = EntityState.Modified;
                          db.SaveChanges();
  
  
                          return RedirectToAction("Edit", "SURV_Main", new { id = viewModel.Survey_ID });
  
                      }
  </code></pre>
  
  <p>Please give some guidance to me.
  Thanks!</p>