Can an object be declared above a using statement instead of in the brackets
<p>Most of the examples of the using statement in C# declare the object inside the brackets like this:</p>

<pre><code>using (SqlCommand cmd = new SqlCommand("SELECT * FROM Customers", connection))
{
   // Code goes here
}
</code></pre>

<p>What happens if I use the using statement in the following way with the object declared outside the using statement:</p>

<pre><code>SqlCommand cmd = new SqlCommand("SELECT * FROM Customers", connection);
using (cmd)
{
   // Code goes here
}
</code></pre>

<p>Is it a bad idea to use the using statement in the way I have in the second example and why?</p>
