title: Entity Framework with SQLite Error: An error occurred while reading from the store provider's data reader
body: <p>I'm using SQLite 1.0.89 with EF 5 .NET Framework 4.5 on VS2013 in a WPF application in C#.
  The DB size is not big and the table that the program use contain max 1000 row.</p>
  
  <p>using the program I found this error often:</p>
  
  <blockquote>
    <p>An error occurred while reading from the store provider's data reader.
    See the inner exception for details.</p>
  </blockquote>
  
  <p>the inner exception is :</p>
  
  <blockquote>
    <p>{"library routine called out of sequence\r\nnot an error"}</p>
  </blockquote>
  
  <p>Other time the inner exception is:</p>
  
  <blockquote>
    <p>Connection was closed, statement was terminated</p>
  </blockquote>
  
  <p>Another time i found:</p>
  
  <blockquote>
    <p>unknown error\r\nno connection handle available</p>
  </blockquote>
  
  <p>I found this article searching:</p>
  
  <p><a href="https://stackoverflow.com/questions/11376990/parallel-foreach-loop-creating-multiple-db-connections-throws-connection-errors/11401869#11401869">Parallel.Foreach loop creating multiple db connections throws connection errors?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7050873/sqlce-database-size-issue">SQL Server CE database size issue</a></p>
  
  <p>but no one solve my problem.</p>
  
  <p>The query that the program do IS NOT inside a loop, but are single query performed when button is pressed on the UI but i noticed that the error happens more often (bun not only) when I press the query button a lot of time faster.</p>
  
  <p>Other thing. The error happens more often (but again not only) when the DB Context is access via a properties istead of a method example:</p>
  
  <pre><code>public List&lt;Product&gt; ProductList
  {
  get {
        return DBContext.Products.ToList();
      }
  }
  </code></pre>