I need to separate database access error (like wrong username) from database query error (like select insert..column not exist etc.). They will both throw SqlException. But I want my program to continue when a query error is thrown but and shut down when an access error is thrown.
How can I separate these two errors? Write my own exception?
I suggest checking the Number propery of the SqlException.
See my answer to SqlException catch and handling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With