title: Why does my database not open?
body: <p>I am using SQLite in a windows 8.1 mobile app and when I am trying to delete something from the database I get an exception in the method <code>RunInTransaction</code>:</p>
  
  <pre class="lang-all prettyprint-override"><code>Cannot create commands from unopened database.
  </code></pre>
  
  <p>But when I try to insert something it works fine!
  This is the insertion method:</p>
  
  <pre class="lang-all prettyprint-override"><code>// Inserts a new place in the Places table.   
  public void InsertPlace(PlacesTable place) {
      using (var dbConn = new SQLiteConnection(App.DB_PATH)) {
          dbConn.RunInTransaction(() =&gt; {
              dbConn.Insert(place);
          });
      }
  }
  </code></pre>
  
  <p>And this is the delete method:</p>
  
  <pre class="lang-all prettyprint-override"><code>// Deletes all the places from the database.  
  public void DeletePlaces() {
      using (var dbConn = new SQLiteConnection(App.DB_PATH)) {
          dbConn.RunInTransaction(() =&gt; {
              dbConn.DropTable&lt;PlacesTable&gt;();
              dbConn.CreateTable&lt;PlacesTable&gt;();
              dbConn.Dispose();
              dbConn.Close();
          });
      }
  }
  </code></pre>
  
  <p>Why does this exception occur in the second case?</p>
  
  <p>So, I found out that <code>Dispose</code> and <code>Close</code> were responsible for the exception, though I would like someone to explain me why this happened. 
  Was <code>Close</code> causing a problem because I had <code>using (var dbConn = new SQLiteConnection(App.DB_PATH))</code> and <code>Dispose</code> for a similar reason?
  I had found this at a tutorial, so it took me some time until I thought that the code had a mistake.</p>