Loading

how to display an image from database access??

Submitted by: 


this is my coding for the search button where actually i want all the details for the searched staff will be display

  1. Try
  2.  
  3.  
  4. sql = "SELECT * FROM Staff WHERE staff_ic = '" & sticnumbertxt2.Text & "'"
  5. con.Open()
  6. Dim cmd As OleDbCommand
  7. Dim dr As OleDbDataReader
  8.  
  9. cmd = New OleDbCommand(sql, con)
  10. dr = cmd.ExecuteReader
  11.  
  12. While dr.Read()
  13. stnametxt2.Text = dr("staff_name")
  14. staddresstxt2.Text = dr("staff_address")
  15. stpostcodetxt2.Text = dr("staff_postcode")
  16. ststatetxt2.Text = dr("staff_state")
  17. stcontacttxt2.Text = dr("staff_contact")
  18. stphonetxt2.Text = dr("staff_phone")
  19. staffid.Text = dr("staff_id")
  20. staffPictureBox2.Image = dr("staff_image")
  21. End While
  22. Catch ex As Exception
  23. MessageBox.Show(ex.Message)
  24. End Try
  25. con.Close()


AttachmentSize
untitled-34.jpg30.67 KB

In which format you are saving image in access? A snapshot query saving image wold be beneficial!

Regards
Mani

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.