After I delete an entity related to another record, this error occurs due to reference integrity:
"The statement DELETE in in conflict with the constraint...etc"
I manage this error with this code:
Using transazione As ITransaction = sessione.BeginTransaction
Try
sessione.Delete(entity)
transazione.Commit()
Return True
Catch ex As Exception
transazione.Rollback()
Return False
End Try
End Using
After this error, if I try to perform an UPDATE statement, it occours again the same error, even if I would no longer perform the DELETE statement.
Someone can help me to understand where I'm wrong? Thank's