I have implemented the solution as indicated but can't seem to find the code block that is generating the error.
Are you able to check this code and see where this exception is occurring. It could be something quite simple. Its been a long day.
sqlr = cmd.ExecuteReader();
if (!sqlr.IsDBNull(0) && !sqlr.IsDBNull(1))
bytDocument = (byte)sqlr["SupportingDocument"];
strExt = sqlr.GetString(1).ToLower();
//My messages here
strFileName = "test";
// Response.ContentType = "application/octet-stream";
Response.ContentType = "application/pdf";
//Tell browser to save rather than display inline.
Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFileName+strExt);
//Show processing error