在PictureBox中如何显示Access数据库里的一个OLE对像(JPG格式的图片)
请问:在PictureBox中如何显示Access数据库里的一个OLE对像(JPG格式的图片)
大侠们给点提示吧!
[CODE]dim myconn as new SqlConnection(..........)
dim cmd as new SqlCommand("Select img1 from tpc where id=1",myconn)
conn.Open()
dim myReader as new SqlDataReader()
myReader = cmd.ExecuteReader()
if reader.Read() then
dim ms as new MemoryStream((byte[])myReader["img1"])
dim myImg as new Image.FromStream(ms, true)
reader.Close()
conn.Close()
pictureBox1.Image = image
end if
.[/CODE]
[此贴子已经被作者于2006-11-15 20:18:48编辑过]