110,533
社区成员
发帖
与我相关
我的任务
分享
public DataSet Select_Photos()
{
string sql = @"select p.photos,t.courier_number from md_tag t inner join md_photos p on p.id = t.mp_id";
DataSet ds = DBHelper.GetSet(sql,CommandType.Text);
return ds;
}
Byte[] bytes = (Byte[])rows[i]["columnename"];
MemoryStream ms = new MemoryStream(bytes);
Bitmap pictureBlob = new Bitmap(Bitmap.FromStream(ms));
this.picturebox.Image = pictureBolb;
DataSet ds = sr.Select_Photos();
foreach (DataRow row in ds.Tables[0].Rows)
{
Byte[] bytes = (Byte[])row[i]["photos"];
MemoryStream ms = new MemoryStream(bytes);
Bitmap pictureBlob = new Bitmap(Bitmap.FromStream(ms));
this.pboxMain.Image = pictureBlob;
}
[/quote]
自己控制好逻辑,循环给pboxMain赋值?关键代码是这样。[/quote]
已经可以了 谢谢了老哥
DataSet ds = sr.Select_Photos();
foreach (DataRow row in ds.Tables[0].Rows)
{
Byte[] bytes = (Byte[])row[i]["photos"];
MemoryStream ms = new MemoryStream(bytes);
Bitmap pictureBlob = new Bitmap(Bitmap.FromStream(ms));
this.pboxMain.Image = pictureBlob;
}
[/quote]
自己控制好逻辑,循环给pboxMain赋值?关键代码是这样。
DataSet ds = sr.Select_Photos();
foreach (DataRow row in ds.Tables[0].Rows)
{
Byte[] bytes = (Byte[])row[i]["photos"];
MemoryStream ms = new MemoryStream(bytes);
Bitmap pictureBlob = new Bitmap(Bitmap.FromStream(ms));
this.pboxMain.Image = pictureBlob;
}