title: Local Database Update Existing Record - Windows Phone 8
body: <p>I am having trouble to update data from my local database. This is my code:</p>
  
  <pre><code>private void appBarOkButton_Click(object sender, EventArgs e)
      {
  
  
          string selectedRowOrderId = "";
          if (NavigationContext.QueryString.TryGetValue("selectedItem", out selectedRowOrderId))
          {
              int selectedID = int.Parse(selectedRowOrderId);
              var query = from TblCustomers customer in orderDB.Customers
                          where customer.Id == selectedID
                          select customer;
  
             TblCustomers editCustomer = query.FirstOrDefault();
              if (editCustomer != null)
                  editCustomer.Name = txtBoxCustomerName.Text;
  
                  App.ViewModel.SaveChangesToDB();
  
  
  
                   // Return to the main page.
                  if (NavigationService.CanGoBack)
                  {
                      NavigationService.GoBack();
                  }
              }
      }
  </code></pre>
  
  <p>And this is the model side:</p>
  
  <pre><code>public void SaveChangesToDB()
      {
          orderDB.SubmitChanges();
      }
  </code></pre>
  
  <p>When I try to change something in Database, Everythings look OK while debugging. But nothing is changing at the end. Could you help me please.</p>