Hi
I've implemented an Error log in SQL where trappable errors are recorded. However, I ran into a situation where I'm not sure what to do. Basically I have this in a nutshell:
(the Company object is created & populated in other part of code..)
Try
'Company email has length of 20 in SQL.
'Generate error on purpose
Company.CompanyEmail = "shshshhsdhsdhhsdhsdhhhds@mycom.com"
Catch ex As System.Exception
dim ErrorObject as New ErrorEntity
Dim adapter As DataAccessAdapter = New DataAccessAdapter
'Set one properties
ErrorObject.ErrorMessage = ex.Message
ErrorObject.ErrorTime = System.DateTime.Now()
'Save to db
Me.adapter.SaveEntity(ErrorObject)
End Try
OK - what happens is, of course, the SSLgen classes catch the error as a System.ArgumentOutOfRangeException in the SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ValidateValue method
The problem is that now I can't use the ErrorEntity to write the error to the db. Stepping through the code just "skips" right over it. I need a way to "Clear" or set the validation back to true so I can save the error info to the db..
Thanks