0

hi i have a stored image in my database. i want it to be displayed in picturebox. anyone here know how to that?
here is my code

Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
        Dim index As ListView.SelectedIndexCollection = ListView1.SelectedIndices
        Dim i As Integer = 0
        For Each i In index
            txtConID.Text = ListView1.Items(i).SubItems(0).Text
            txtLname.Text = ListView1.Items(i).SubItems(1).Text
            txtfname.Text = ListView1.Items(i).SubItems(2).Text
            txtmname.Text = ListView1.Items(i).SubItems(3).Text
            txtadd.Text = ListView1.Items(i).SubItems(4).Text
            txtcontactno.Text = ListView1.Items(i).SubItems(5).Text
            txtemail.Text = ListView1.Items(i).SubItems(6).Text
            txtDOB.Text = ListView1.Items(i).SubItems(7).Text
        Next
        PictureBox1.Image = ???


    End Sub
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by debasisdas
0

that will depend on how the image is stored in the database
1. if you are storing only the file path

You need to retrieve the path from Db and point to the same from Picture Box.

2. if the image is stored as a binary stream.

retrieve the stream
recreate the image from stream
display in Picture Box.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.