title: Disposing of SQL Connection
body: <p>I have a SQL class that connects to the DB and retreives a DataTable. I am aware that the SqlConnection must be disposed when finished. I know this can be done using a <code>using</code> block, but is it also acceptable to put the <code>Dispose()</code> call inside the destructor of this class?</p>
  
  <p>Herre is my code:</p>
  
  <pre><code>public class SQLEng
  {
  
      //Connection String Property
      //Must be set to establish a connection to the database
      public string ConnectionString{ get; set; }
      SqlConnection _Conn;
  
      //Overridden Constructor enforcing the Connection string to be set when created
      public SQLEng(string connectionString)
      {
          ConnectionString = connectionString;
          _Conn = new SqlConnection(connectionString);
      }
  
      //ensure the SqlConnection is disposed when destructing this object
      public ~SQLEng()
      {
          _Conn.Dispose();
      }
  
      //various other methods to get datatables etc...
  }
  </code></pre>
  
  <p>Basically i wish to have a class variable SqlConnection, rather than instantiate the SqlConnection inside every method that accesses the DB. Is this sound practise?</p>