title: How to Fetch and Display an Image from the Database in ASP.Net and C#
body: <p>There are so many good tutorials out there about inserting an image inside a table in a database, using the <strong>FileUpload</strong> controller.</p>
  
  <p>Yet I cannot find a good tutorial about how to fetch these images and display them.</p>
  
  <p>When I used to store the image name or path in the database (as a Varchar), It would be very simple by doing something like this...</p>
  
  <p><strong>HTML/ASP:</strong></p>
  
  <pre><code>&lt;img src="" runat="server" id="myImage" /&gt;
  </code></pre>
  
  <p><strong>C#:</strong></p>
  
  <pre><code>myImage.Src = myReader.getValue(0).toString();
  </code></pre>
  
  <p><strong>The Result:</strong></p>
  
  <pre><code>&lt;img src="/Images/pic.png" runat="server" id="myImage" /&gt;
  </code></pre>
  
  <p>And Voila, the picture will be displayed.</p>
  
  <p>But Now I would like to fetch uploaded images, not a path, means the type of the table column is IMAGE.</p>
  
  <p>Some tutorials will eventually lead to display a picture in FULL SCREEN.</p>
  
  <p>I do not want that, I simply want to fetch and display the image the same way it is displayed in the previous example, with a given size and place inside my web page.</p>
  
  <p>Why am I uploading images to the database? Because these images are "Profile Pictures", not public pictures, I do not want a guest to simply browse for /Images/ to find all the pictures of my web site, public and private.</p>