I created a simple MVC3 project just like the Music Store sample. Everything worked just fine. It was then time to port the database to a GoDaddy server and now I can't delete items from the database.
This is the error:
The DELETE statement conflicted with the REFERENCE constraint \"Captions_Item_Captions\". The conflict occurred in database \"mattymattmofo\", table \"dbo.Captions\", column 'Item_ItemId'.\r\nThe statement has been terminated.
//
// POST: /NavigationManager/Delete/5
[Authorize(Roles = "Administrator")]
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
Item item = db.Items.Find(id);
db.Items.Remove(item);
db.SaveChanges();
return RedirectToAction("Index");
}
Can anyone please help?