title: Retrieve image from database and display on ASP.NET without httphandler
body: <p>I have an ASP.NET website where I want to enter EmployeeName , and upload EmployeePhoto, then retrieve Employee Info and display Employeephoto on website.</p>
  
  <p>I have created an SQL table with EmployeePhoto - type "image".</p>
  
  <p>I use this code to insert photo  on (it works fine)
  <strong><a href="http://i.stack.imgur.com/qmphk.png" rel="nofollow">http://i.stack.imgur.com/qmphk.png</a></strong></p>
  
  <p>However when I want to load my inserted photo in SQL into website, I get this Inputstream does not exist error.</p>
  
  <p>load photo codes &amp; error <strong><a href="http://i.stack.imgur.com/X2okW.png" rel="nofollow">http://i.stack.imgur.com/X2okW.png</a></strong> </p>
  
  <p><em>I don't want to use the httphandler solution</em></p>
  
  <p><strong>EDIT: I have no correct answer yet :(</strong></p>
  
  <p>Thank you very much.</p>
  
  <pre><code>            cnn.Open();
              SqlCommand cmd = new SqlCommand("SELECT EmployeeFirstName,EmployeeLastName,EmployeePhoto FROM Employees WHERE EmployeeID = @myvalue", cnn);
              cmd.Parameters.AddWithValue("@myvalue", (ListBox1.SelectedValue));
              SqlDataReader dr = cmd.ExecuteReader();
              if (dr.HasRows)
              {
                  while (dr.Read())
                  {
                      TextBox1.Text = dr.GetString(0);
                      TextBox2.Text = dr.GetString(1);
  
  
                      byte[] imagedata = (byte[])dr[2];
                      InputStream.Read(imagedata, 0, (byte[])dr[2]);
                      Image Image1 = Image.FromStream(imagedata);
  
                  }
              }
              cnn.Close();
  </code></pre>