title: How can I use timeout for try-catch?
body: <p>I have a try-catch for oledbconnection like this:</p>
  
  <pre><code>try
  {
          OleDbConnection Connection;
          using (Connection = new OleDbConnection("Provider=MSDAORA.1;Data Source=DATABASE:1521/orcl//orcl1;Persist Security Info=True;Password=PASS;User ID=USER"))
          {
              Connection.Open();
              v1 = 1;
              Connection.Close();
          }
  }
  catch (Exception)
  {
          v1 = 0;
  }
  </code></pre>
  
  <p>When I can't connect database, try going to catch and return <code>v1 = 0</code>. It's working but when connection waiting so much(for example 30-40  seconds), try trying to connect and page waiting so much.</p>
  
  <p>I tried <code>Connect Timeout</code> for <code>oledbconnection</code> but does not working.</p>
  
  <p>I need to use try for few secs, if any problem, need to go catch.</p>
  
  <p>How can I do that?</p>