I want to wrap certain database processing in Try blocks, check any error and retry (within limits) if they are expected, e.g. locking. However, I'm having trouble identifying the native SQL error code within the Exception, e.g.
blTry = TrueWhile blTry Try Me.FillByStoredProcedure(StoredProc) blTry = False Catch ex As Exception blTry = CheckTheError(ex) End TryEnd While
I can see the SQL Error Description but I want to evalute errors using native SQL error codes.
Cheers, Peter
Perfect - thank you.
Oh, and if the type is a DataLayerSavingException, then it will have the exceptions listed within the SavingErrors collection because there might be more than one, but that's only if you set your business object's ErrorSavingMode to ContinueOnError (non default) and wrap the bo.Save() in a try/catch.