hi.i need help on this... i have a datagridview and when i clicked the datagridview shows in textbox and i have this one problem with my picture box...it only shows the same picture even if the saved picture in my database is not the same...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGet.Click
If dgvUser.SelectedRows.Count > 0 Then
Dim employeeID As Integer = Me.dgvUser.SelectedRows(0).Cells("ID").Value
con.Open()
Dim da As New OleDbDataAdapter("SELECT ID, mail, fname, gender, age, bdate, address, phone, uname, acctype, stats, picfile FROM login " & _
" WHERE ID=" & employeeID, con)
Dim dt As New DataTable
da.Fill(dt)
txtEmpId.Text = employeeID
txtMail.Text = dt.Rows(0).Item("mail")
txtName.Text = dt.Rows(0).Item("fname")
cboGender.Text = dt.Rows(0).Item("gender")
txtAge.Text = dt.Rows(0).Item("age")
txtBdate.Text = dt.Rows(0).Item("bdate")
txtAddress.Text = dt.Rows(0).Item("address")
txtPhone.Text = dt.Rows(0).Item("phone")
txtUserName.Text = dt.Rows(0).Item("uname")
cboAccType.Text = dt.Rows(0).Item("acctype")
cboStats.Text = dt.Rows(0).Item("stats")
If Not IsDBNull(dt.Rows(0).Item("picfile")) Then
PicImage = dt.Rows(0).Item("picfile")
For Each pic As Byte In PicImage
myMs.WriteByte(pic)
Next
picPhoto.Image = System.Drawing.Image.FromStream(myMs)
End If
con.Close()
End If
End Sub
End Class