title: How to retrieve a blob from sqlite using sqlite.net
body: <p>I am having trouble retrieving an image from an sqlite db. The image was stored by another process and I can view it correctly using DB Browser for sqlite.</p>
  
  <p>I have a the following class, which I would like to use in order to store the image:</p>
  
  <pre><code> public class Tile
   {
      public Byte[] TileData { get; set; }
      public Int64 ZoomLevel { get; set; }
   }
  </code></pre>
  
  <p>I am then using the following query to retrieve the corresponding tiles:</p>
  
  <pre><code>mbTilesConnection.Query&lt;Tile&gt;("select 'zoom_level' as 'ZoomLevel', 'tile_data' as 'TileData' from tiles where zoom_level = ?", zoomLevel);
  </code></pre>
  
  <p>In this case <code>tiles</code> is a <strong>view</strong> containing the <code>zoom_level</code> and <code>tile_data</code> columns.</p>
  
  <p>The query returns the correct number of rows but it seems that <code>Tile.ZoomLevel</code> and <code>Tile.TileData</code> are not mapped correctly to the corresponding columns in the <code>tiles</code> view.</p>
  
  <p><strong>Edit</strong>: here is a linked question: <a href="https://stackoverflow.com/questions/43942865/how-do-i-query-a-view-in-sqlite-net">How do I query a View in SQLite.net?</a></p>