請幫忙

mike_ylp 2006-10-25 05:13:17
winform 從Access中讀取圖片顯示到picturebox中
...全文
108 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
任亚军 2006-10-25
  • 打赏
  • 举报
回复
你先判断ds.tables.count>0
mike_ylp 2006-10-25
  • 打赏
  • 举报
回复
byte[] byteImage = (byte[])ds.Tables[0].Rows[0]這句老是有問題,說是沒有資料列
Knight94 2006-10-25
  • 打赏
  • 举报
回复
Sample code as follows:
byte[] byteImage = (byte[])ds.Tables[0].Rows[0][图片列名称];
MemoryStream ms = new MemoryStream( byteImage, true );
ms.Read( byteImage, 0, byteImage.Length );
ms.Position = 0;
yourPictureBox.Image = new Bitmap( ms );
icehawk 2006-10-25
  • 打赏
  • 举报
回复
byte[] byteImage = (byte[])ds.Tables[0].Rows[0][图片列名称];

byte[] byteImage = (byte[])ds.Tables[0].Rows[0][图片列名称];
Image img = (Image)ConvertFrom( byteImage );

mike_ylp 2006-10-25
  • 打赏
  • 举报
回复
在線等,請幫幫忙

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧