title: Internal .Net Framework Data Provider error 1
body: <p>I'm developing a WinForm app with Visual Studio 2012 Ultimate edition with all service pack, C# and .NET Framework 4.5.</p>
  
  <p>I get this exception:</p>
  
  <pre><code>Internal .Net Framework Data Provider error 1
  </code></pre>
  
  <p>With this stack:</p>
  
  <pre><code>   en System.Data.ProviderBase.DbConnectionInternal.PrePush(Object expectedOwner)
     en System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject)
     en System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory)
     en System.Data.SqlClient.SqlConnection.CloseInnerConnection()
     en System.Data.SqlClient.SqlConnection.Close()
     en AdoData.TRZIC.DisposeCurrentConnection() 
     en AdoData.TRZIC.Finalize() 
  </code></pre>
  
  <p>In the destructor:</p>
  
  <pre><code>~TRZIC()
  {
      DisposeCurrentConnection();
  
      if (this.getCodeCmd != null)
          this.getCodeCmd.Dispose();
  }
  
  private void DisposeCurrentConnection()
  {
      if (this.conn != null)
      {
          if (this.conn.State == ConnectionState.Open)
              this.conn.Close();
  
          this.conn.Dispose();
          this.conn = null;
      }
  }
  </code></pre>
  
  <p>I get the exception in line <code>this.conn.Close();</code>.</p>
  
  <p>And <code>conn</code> is <code>private SqlConnection conn = null;</code></p>
  
  <p>Do you know why?</p>