Is it possible to use GetThumbnailImage with images being pulled from an SQL
DB and if so how? All examples I've seen refer to working with an actual
image stored on the server.
My code for pulling the image from the DB is below if it makes a difference.
Thanks in advance
private void Page_Load(object sender, System.EventArgs e)
{
string imageID = Request.QueryString["ID"];
SqlDataReader imageContent = GetImages(imageID);
imageContent.Read();
Response.ContentType = imageContent["ContentType"].ToString();
Response.OutputStream.Write((byte[])imageContent["CoverShot"],0,System.Conve
rt.ToInt32(imageContent["ContentLength"]));
Response.End();
}
private SqlDataReader GetImages(string imageID)
{
SqlConnection con = new
SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings.Get("Co
nRead"));
SqlCommand cmd = new SqlCommand("SELECT CoverShot, ContentType,
ContentLength FROM Products WHERE ProductID = '" + imageID + "'",con);
con.Open();
return cmd.ExecuteReader(CommandBehavior.CloseConnection) ;
}