Identify sql exception in c#?
<p>how to catch sql exception with its error code(error no) to identify which exception is exactly thrown in c# ?
for example  database is offline or there is reference row in other table so sql wont allow me to delete row but how exactly i could identify what is the problem in catch so that i can display message to the user in my application </p>
