By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,391 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,391 IT Pros & Developers. It's quick & easy.

How to assign the image field in the picture Box

P: n/a
Iam trying to retriving the Image column and display in Picture box

How to assign the image Column in the picture Box.....
Dim file As String = ("D:\Documents and Settings\somasundaram\My
Documents\My Pictures\Srinath.jpg")
Dim MyData() As Byte

MyData = dr("employ_image")
Dim ms As New IO.MemoryStream(MyData)
Dim k As Long
k = UBound(MyData)
'Dim fs As New IO.FileStream("D:\Documents and Settings
\somasundaram\My Documents\My Pictures\Srinath.jpg",
IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
Dim fs As New IO.FileStream(file,
FileMode.OpenOrCreate, FileAccess.Write)

fs.Write(MyData, 0, k)

txt_name.Text = dr.GetValue(1)
txt_address.Text = dr.GetValue(2)
MaskedTextBox1.Text = dr.GetValue(3)
MaskedTextBox2.Text = dr.GetValue(4)
txt_qualify.Text = dr.GetValue(5)
txt_no_yrs_exp.Text = dr.GetValue(6)
txt_worked_exp.Text = dr.GetValue(7)
'Emp_image.Image = dr.GetValue(8)
Emp_image.Image = System.Drawing.Image.FromStream(ms)
'Here iam getting ERROR....
MsgBox("Image Retrived")

Feb 27 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.