I created a delete but when I run the error it gives me:
An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException', I have looked for help, but everything that appears is for #C, I need a solution for VB.
I think the problem is that the defect table is associated with a process, from the process table. And the program does not let you delete to not leave the process "hanging" ...
' GET: DEF_DEFECT/Delete/5
Function Delete(ByVal id As String) As ActionResult
If IsNothing(id) Then
Return New HttpStatusCodeResult(HttpStatusCode.BadRequest)
End If
Dim dEF_DEFECT As DEF_DEFECT = db.DEF_DEFECT.Find(id)
If IsNothing(dEF_DEFECT) Then
Return HttpNotFound()
End If
Return View(dEF_DEFECT)
End Function
' POST: DEF_DEFECT/Delete/5
<HttpPost()>
<ActionName("Delete")>
<ValidateAntiForgeryToken()>
Function DeleteConfirmed(ByVal id As String) As ActionResult
Dim dEF_DEFECT As DEF_DEFECT = db.DEF_DEFECT.Find(id)
db.DEF_DEFECT.Remove(dEF_DEFECT)
db.SaveChanges()
Return RedirectToAction("Index")
End Function