I am getting this error
ERROR: Unable to Save Full Address - An object with the same key already exists in the ObjectStateManager. The existing object is in the Modified state. An object can only be added to the ObjectStateManager again if it is in the added state.
After the user clicks the update button...I fire a series of method calls to a class. Each method updates a different section of the database.
I just added one more at the end and now I have hit this error message.
Here is the code
public bool SaveFullAddress(string cartID, string street, string city, string province, string country, string postal)
Boolean result = false;
using (CommerceEntities db = new CommerceEntities())
var myAdd = (from c in db.UBOecShips
where c.CartID == cartID
if (myAdd == null)
MessageBox.Show("The address was not saved as no record has been initiated");
myAdd.shipStreet = street;
myAdd.shipCity = city;
myAdd.shipProv = province;
myAdd.shipCountry = country;
View Complete Post