How to display an image of the database in a vb.net form

0

I would like to know how can I display a database image in a form in vb.net

It's something like the following:

info.TextBox5.Text = DataGridView1.SelectedRows(0).Cells(5).Value 

Only this code I use to display database text in a new form. How can I do this with an image?

    
asked by anonymous 05.04.2016 / 13:49

1 answer

0

If your image is already stored in a hidden column of your DataGridView1 , type Bitmap or Image , you only need a PictureBox:

info.PictureBox1.Image = DataGridView1.SelectedRows(0).Cells(6).Value

As Kaizonaro said, however, depending on how your image is stored, you will have to create the object Image in time, with additional commands, which will vary as appropriate (for example, if you have a binary stream it would be one way, if a base64 string, another way, etc.)

    
21.06.2016 / 22:31