将PICTUREBOX中显示的图片,存入数据库中

将PICTUREBOX中显示的图片(不知道图片路径),存入数据库中:
----------------------------------------------------------
 
 1if (null != picBox.Image)
 2{
 3  using(System.IO.MemoryStream ms = new System.IO.MemoryStream())
 4  {
 5    picBox.Image.Save(ms, picBox.Image.RawFormat);
 6    Byte[] bt = new Byte[ms.Length];
 7    ms.Read(bt, 0, ms.Length);
 8    //将bt作为参数,传入 DBCOMMAND即可
 9  }
 
10}
  
posted @ 2005-08-04 18:05  三角猫  阅读(849)  评论(0编辑  收藏  举报