title: How to use try catch error for sql query timeout?
body: <p>How can i use try catch if there is an error in the connection to the sql query in c#?</p>
  
  <p>If I use the simple code below it does work but the time it takes for an error to occur is too long. How can I get the try catch to handle the error quicker?</p>
  
  <pre><code>try
  {
    //sql command
  }
  catch
  {
    //display connection error
  }
  </code></pre>