while (dr.Read())            {                Binytes=(byte[])dr.GetValue(0);
               
            }            if (Binytes.Length!=0)
            {
                MemoryStream ms = new MemoryStream(Binytes);
                Bitmap im = new Bitmap(ms);----报错:参数无效
                //Image im = Image.FromStream(ms);---同样报错:参数无效
                //Image im = System.Drawing.Image.FromStream(ms); --同样报错:参数无效
                pictureBox1.Image = im;
            } 

解决方案 »

  1.   

    自己调试不明白你为什么while read循环后再显示图片,你只能显示最后一张
      

  2.   

    ???
    while
    这个逻辑后面的东西试试看这样
       MemoryStream ms=new MemoryStream(new byte[]{});
                ms.Position = 0;
                ms.Seek(0, SeekOrigin.Begin);
                Image im = Image.FromStream(ms);