G
Guest
I have an application where I need to classify the errors that occur when I'm
accessing the database but not changing its structure. There are a few types
of errors:
- Connectivity error: the database server cannot be accessed
- Query error: there is a parse error in the query I'm trying to execute
- Referential integrity error: a violation of referential integrity occurred
How can I filter the SqlException so that I could throw a more especific
exception?
Remarks: I don't wanna make a switch/case for the almost 4000 error numbers
of SQL Server.
Thanks
accessing the database but not changing its structure. There are a few types
of errors:
- Connectivity error: the database server cannot be accessed
- Query error: there is a parse error in the query I'm trying to execute
- Referential integrity error: a violation of referential integrity occurred
How can I filter the SqlException so that I could throw a more especific
exception?
Remarks: I don't wanna make a switch/case for the almost 4000 error numbers
of SQL Server.
Thanks