When saving the Image in the database it is saved in a field of type Image the problem is that when recovering the image and receiving it in a variable type [] byte doing the correct conversion I can not visualize in the control destined, I have identified that when sending it to the database the number of bytes is 139551 byte [139551] , but when retrieving it from the database the number of bytes is 13 byte [13] obviously you could not change the field type to varbinary (MAX) for supporting only 8000 bytes ...
DB recovery
DataTable Tabla = ConsultasMasivasN.ConsultarSoporteIndicadorN(CodigoGI, UsuarioS);
ViewState["TblSoporte"]=Tabla;
gridListado.DataSource = Tabla;
gridListado.DataBind();
Session["Consulta"] = Tabla;
Handler File
if (context.Session["Consulta"] != null)
{
DataTable tbRegistro = (DataTable)context.Session["Consulta"];
DataRow drRegistro = tbRegistro.Select(string.Format("Codigo={0}", context.Request.QueryString["Codigo"]))[0];
byte[] imagen = (byte[])drRegistro["Soporte"];
context.Response.ContentType = "image/jpg";
context.Response.OutputStream.Write(imagen, 0, imagen.Length);
}
I appreciate your help !!!!