.net读取二进制流图片

    string conn = ConfigurationManager.AppSettings["ConnectionString"].ToString();
            SqlConnection Connection = new SqlConnection(conn);
            Connection.Open();
            String SqlCmd = "select * from LocationImage where LIIntNo='"+imageid+"' ";
            SqlCommand CmdObj = new SqlCommand(SqlCmd, Connection);

            SqlDataReader SqlReader = CmdObj.ExecuteReader();
            SqlReader.Read();
            Response.ContentType = "image/jpeg";
            Response.OutputStream.Write((byte[])SqlReader["LocImage"], 0, ((byte[])SqlReader["LocImage"]).Length);
            Response.End();
            Connection.Close();

原文地址:https://www.cnblogs.com/glj1203/p/1857467.html