using not the same as try/catch/finally !! using ensures that Dispose automatically called in the IDisposable in parentheses, so for now
using (SqlConnection conn = new SqlConnection(...)) { }
coincides with
SqlConnection conn = new SqlConnection(...); try { } finally { conn.Dispose(); }
there are no capture locks involved at all, no errors are caught!
If you want to get rid of all disposable objects that you create in a timely manner, then yes, you should use the using block for each of them.
Sometimes itβs easier to read everything outside the try block and then delete everything in one finally block (an example for this would be painting in Windows Forms applications. Sometimes you need a lot of brushes and pens. You can create them before try , use them in the block and destroy them in the finally block).
This is basically a coding style issue.
source share