title: How to know actual problem because of which SqlException is thrown?
body: <p>I want to handle different problems, while doing database operations, differently.</p>
  
  <p>e.g. The operation may fail because of wrong database credentials or due to network problem. Or it may fail because the query is not correct (if string value is being passed in the int type column)</p>
  
  <p>In my C# code, we only have <code>SqlException</code> which has collection of <code>SqlErrors</code>. However there are many severity levels.</p>
  
  <p>How can i easily identify the cause of the SqlException ? How can i determine the exception is because of the connectivity problem or authentication failure or because of the problem with the query.</p>
  
  <p>I am using SQL Server 2005.</p>