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