I am getting this error \"The object cannot be deleted because it was not found in the ObjectStateManager.\"
My code is:
protected MyEntities sql
I got this problem and solve it. Just copy below code:
sqlEntities.Attach(entity); sqlEntities.Remove(entity); sqlEntities.SaveChanges();