I have some 3-4 stored procedures ― which I can modify if needed ― that use RAISERROR
to inform my application of some fatal errors on the database side. Some
When you catch a SqlException
, you can inspect its Errors
collections which contains the detailed error messages.
Those SqlError objects contained very detailed information - including error code, message and so forth.
Using that information, you should be able to easily distinguish between connection-based errors, or errors that your raise yourself.