title: What types of code blocks should I enclose with try-catch statement?
body: <p>I have read and discussed the following questions and articles deeply and many others now and in the past:</p>
  
  <p><a href="https://stackoverflow.com/questions/1722964/when-to-use-try-catch-blocks">When to use try/catch blocks?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4827628/main-method-code-entirely-inside-try-catch-is-it-bad-practice">Main method code entirely inside try/catch: Is it bad practice?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5199146/when-to-use-try-catch-blocks">When to use Try Catch blocks</a></p>
  
  <p>I will make this article the coding standard of exception handling in my organization! avery nice one but didn't answer me:
  <a href="http://www.codeproject.com/Articles/9538/Exception-Handling-Best-Practices-in-NET" rel="nofollow noreferrer">http://www.codeproject.com/Articles/9538/Exception-Handling-Best-Practices-in-NET</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5632881/what-is-the-best-practice-for-try-catch-blocks-to-create-clean-code">What is the Best practice for try catch blocks to create clean code?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c-sharp">Best practices for exception management in Java or C#</a>
  Here: I didn't like this statment :(
      You should not try to catch each and every exception in every possible place.</p>
  
  <p><a href="https://stackoverflow.com/questions/4177404/should-multiple-try-catch-blocks-in-a-method-be-combined">Should multiple Try/Catch blocks in a method be combined</a></p>
  
  <p>I have a problem when i need to decide to enclose some block of code with try-catch statement, I know that the code should be enclosed is the faulty code, And i must check what I can check, but for example:
  I need to write a line in some text file, I should check if the file is exists, and if I have permission to write on it, should I check if there is a space on the disk, or the disk is writable, and if i checked the space, what if something happened while I writing the file (Some other app or thread used the space, or the removable drive has been removed?), Is it a best practice if I checked those things and handled IOException and SecurityException and other potential exceptions, or I should only check without try-catch?</p>
  
  <p>Another example:
  I am using EntityFramework to access database, when accessing something may contact the database, I know I should check the connection if closed and try to open it, but there are many and many things may cause a failure in this statement, the database may be on a removable drive, this drive may be removed while reading, the service of the DBMS may stop for any reason, no space exception may be thrown, the scheme of the database may change after I try to execute my code for some **** reason,How can I prevent my code from fail, can I just check every thing I can check, and go on? or I should use try catch for exception I can expect even though I have checked them?</p>
  
  <p>Give me references of your answers please, not a general answers!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>And sure read this :
  <a href="http://msdn.microsoft.com/en-us/library/seyhszts.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/seyhszts.aspx</a></p>