Declaring reused variables at class or method level when they're required
<p>Does RAII apply to C#? More specifically, when declaring variables, is there any difference internally between declaring a variable used in different methods at the class level (what I do but not thread safe) or at each method level where it is declared/instantiated several times as soon as it is needed and then goes out of scope?</p>

<p>For example, a SqlConnection object may be used in different methods of a class - should it be declared at the top/class level or separately in each method?</p>

<pre><code>class Test
{
   SqlConnection conn;
   ....
</code></pre>

<p>Instantiated in a using block and then goes out of scope in several different methods.</p>

<p>Or...</p>

<pre><code>public void A()
{
  SqlConnection conn = new SqlConnection();
}
</code></pre>

<p>And likewise for several methods.</p>

<p>Thanks</p>
