• 0

Help me with this WPF please


Question

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

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.