I'm trying to trap an error in a try and catch. I am getting an error (Unique Key Violation) on the following method in my entity class.
Protected Overrides Overloads Function UpdateEntity() As Boolean
Dim dao As WeldSpec_SpotDAO = CType(CreateDAOInstance(), WeldSpec_SpotDAO)
Return dao.UpdateExisting(MyBase.Fields, MyBase.Transaction)
End Function
This error occurs after I call the .Save method on an instance of the entity. I have wrapped the .Save in a try/catch but it does not catch it.
Try
x.Save()
Catch ex As Exception
MsgBox("Exception")
End Try
Am I missing something here? Seems pretty basic, but I am not sure how to trap this.