I have a database table trigger that can RAISERROR at multiple point of the code.
I know that we can add some custom arguments along with the RAISERROR calls (I think that those parameters are mainly for setting a custom error message).
All of this is fine.
On the .Net part of the code (C# for me), when I catch the related error, everything is almost fine, I can get it's custom message, state, severity...
... but I'm still struggling to get back my custom parameters from this C# SqlException object and I failed to find information after a long research.
My questions are :
- Is it possible to recover those parameters directly from the
SqlException? (without having to parse the generated error message) - If possible, how to get them ? Where are they hidding inside the exception object?
Thank you.