Kuldeep Katiyar

Kuldeep Katiyar

  • 1.9k
  • 25
  • 8k

ImageHandler

Feb 28 2016 2:31 PM
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
System.Data.DataSet dr = user.RetriveImage();
if (dr.Tables[0].Rows.Count > 0)
{
context.Response.ContentType = dr.Tables[0].Rows[0]["img"].ToString();
context.Response.BinaryWrite((byte[])dr.Tables[0].Rows[0]["img"]);
}
}
hi sir,
I have written this code to retrive image from database
in database image datatype is image and value we are saving into bytes
immidate after saving we are retrieving that image but its not displaying.
 please help is any thing we have to add in web configue file i m adding but getting error
 something has been added to httphandlers

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)