Ejemplo n.º 1
0
        private void GetPicture()
        {
            if (DrugCode != "" && DrugCode != null)
            {
                if (!Convert.IsDBNull(db.GetPIVAsDBforObject("select DrugPicture from DDrug where DrugCode='" + DrugCode + "'")))
                {
                    byte[] b = (byte[])db.GetPIVAsDBforObject("select DrugPicture from DDrug where DrugCode='" + DrugCode + "'");

                    MemoryStream stream = new MemoryStream(b, true);
                    stream.Write(b, 0, b.Length);
                    pictureBox1.Image = new Bitmap(stream);
                    stream.Close();
                }
                else
                {
                    pictureBox1.Image = global::PivasDDrug.Properties.Resources.NoPicture;
                }
            }
        }