title: asp.net display image from sqlreader
body: <p>How can I get an image control on webpage to display from sqlreader?</p>
  
  <p>I have an sqlreader with the binary data and content type fields, but don't know how to get it to display to the image control on my page.</p>
  
  <p>found the "GetStream" method, but can't figure out the syntax for what I need.</p>
  
  <p>Fields from sqlreader are: 
  Image1, for binary Data
  Image1Content, for content type (image/jpg)
  Image1Name, for Image Name</p>
  
  <p>Image control on page is "Image1"</p>
  
  <p>I am assigning other controls on the page behind and would like to do the same with the image control/s.</p>
  
  <p>Tried this, but get an error in the reader["Image1"] at the end:</p>
  
  <pre><code> while (reader.Read())
                  Image1.ImageUrl = reader.GetStream("data:image/jpg;base64," + Convert.ToBase64String((byte[])reader.["Image1"]));
  </code></pre>