Hi I have an issue when trying to stream blob image data from a SQL table to
a .aspx page. the code I have works for GIF and JPEG but the images can be
multiple pages and we would like them to open in a TIFF format.
What comes back to the screen is garble.... Can anyone help? Thanks
The code I am using is:
SqlConnection myConn = new
SqlConnection(ConfigurationSettings.AppSettings["strConnection"]);
SqlCommand myComm = new SqlCommand("Select SX_Image_Data from
SX_ACCSXDB_Images where chrBarCode = '" + Request.QueryString["invoice"] +
"'",myConn);
myConn.Open();
try
{
byte [] img = (byte[]) myComm.ExecuteScalar();
MemoryStream ms = new MemoryStream();
ms.Write(img, 0, img.Length);
Bitmap bmp = new Bitmap(ms);
bmp.Save(Response.OutputStream, ImageFormat.Tiff);
}
catch(Exception)
{
Response.Write("<center><h4>The Invoice you are requesting does not
exist in the system</h4></center>");
}