you are storing images in binary in sql server...n you r directly use tostring() function on it..!!!
bool flgImage = false;
byte\[\] buffer = new byte\[0\];
buffer = (byte\[\])SQLHelper.ExecuteScalar("SELECT imgImage FROM dbo.MeasurementImages WHERE intImageID=id");
context.Response.ClearHeaders();
context.Response.Expires = 0;
context.Response.Cache.SetNoServerCaching();
context.Response.Cache.SetMaxAge(TimeSpan.Zero);
context.Response.ContentType = "image/gif";
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.BufferOutput = false;
context.Response.OutputStream.Write(buffer, 0, buffer.Length);
context.Response.Flush();
context.Response.End();
Make image handler file for retriving images from database. this is a better way.
!- F - R - I - E - N - D - S -!