0

i'm new using VB 2008. so i hope somebody could help me. my problem is i want whenever the listbox is checked then the info in the listbox can be shown in multiple textbox along with picture. i used MS Access as my database. here i attach my code. i hope someone could teach me what's wrong and so on. thanks

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ExtremeGTSlayer
0

hm, thanks for the response. when load form, i call the ShowBookLibrary and only book title showing in listbox

'Display the book title only
Private Sub ShowBookLibrary(ByVal conn As OleDbConnection)
Dim select_cmd As New OleDbCommand("SELECT * FROM Library", conn)
Dim reader As OleDbDataReader = select_cmd.ExecuteReader()
IstLibBook.Items.Clear()
Do While reader.Read()
IstLibBook.Items.Add(reader.Item("Title").ToString)
Loop
reader.Close()
End Sub

in my database(Library) have columns --> Title, Author, BookStatus, BookDue
so, this is where i'm stuck.

Private Sub IstLibBook_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles IstLibBook.SelectedIndexChanged
BookTitle.Text = CStr(IstLibBook.SelectedItem)
'Author.Text
'BookDue.Text
'BookStatus.Text
'GetPicture
End Sub

what am i suppost to do to make the other textbox showing the info about the book from the database?

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.