protected void Page_Load(object sender, EventArgs e)
{
int imageid = Convert.ToInt32(Request.QueryString["ACTUAL_IMAGE_PDF"]);SqlDataReader imageContent = GetImage(imageid);
imageContent.Read();
Response.ContentType = imageContent["ImageType"].ToString();
Response.OutputStream.Write((byte[])imageContent["ImageFile"], 0, System.Convert.ToInt32(imageContent["ImageSize"]));
Response.End();
}
private SqlDataReader GetImage(int imageid)
{
SqlConnection myConnection = new SqlConnection("Data Source=*********");SqlCommand myCommand = new SqlCommand("Select * From DBO.RIMS_TEST_TABLE Where imageid=@ImagePDF_Name", myConnection);
SqlParameter imageIDParameter = new SqlParameter("@ImageId", SqlDbType.Int);
imageIDParameter.Value = imageid;
myCommand.Parameters.Add(imageIDParameter);
myConnection.Open();
}
}