SuperJediMedia Posted December 20, 2014 Share Posted December 20, 2014 When I select from a Select List, it shows up in a text box that I can edit it, but when I press Update Button, I get an error. What am I overlooking? private void CustomerUpdateButton_OnClick(object sender, RoutedEventArgs e) { Customer customer = (Customer)CustomerList.SelectedItem; var custResp = new CustomerRepository(); int custid = customer.CustomerId; customer = custResp.GetById(custid); customer.FirstName = FirstNameInput.Text; customer.LastName = LastNameInput.Text; customer.City = CityInput.Text; customer.State = StateInput.Text; custResp.Update(customer); custResp.SaveChanges(); } Trying to update the database, but it doesn't work. Gave me this error. I got An unhandled exception of type 'System.MissingMethodException' Additional information: Method not found: 'Void System.Data.Entity.Infrastructure.DbEntityEntry`1.set_State(System.Data.EntityState)'. Link to comment Share on other sites More sharing options...
Question
SuperJediMedia
When I select from a Select List, it shows up in a text box that I can edit it, but when I press Update Button, I get an error.
What am I overlooking?
private void CustomerUpdateButton_OnClick(object sender, RoutedEventArgs e)
{
Customer customer = (Customer)CustomerList.SelectedItem;
var custResp = new CustomerRepository();
int custid = customer.CustomerId;
customer = custResp.GetById(custid);
customer.FirstName = FirstNameInput.Text;
customer.LastName = LastNameInput.Text;
customer.City = CityInput.Text;
customer.State = StateInput.Text;
custResp.Update(customer);
custResp.SaveChanges();
}
Trying to update the database, but it doesn't work. Gave me this error.
I got An unhandled exception of type 'System.MissingMethodException'
Additional information: Method not found: 'Void System.Data.Entity.Infrastructure.DbEntityEntry`1.set_State(System.Data.EntityState)'.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts