Hi all,
I wanted to load a listbox with items from the database.I just wrote the code using oop.
But on the interface i'm not sure how to read and insert the items in the listbox.
How can i access the items being read at the client side(interface).
Public Sub LoadWorkItem()
' Load the data.
' Select records.
Dim conn As New OleDbConnection
Dim data_reader As OleDbDataReader
conn = GetDbConnection()
Dim cmd As New OleDbCommand("SELECT * FROM work_item ORDER BY [work item number]", conn)
data_reader = cmd.ExecuteReader()
If data_reader.HasRows = True Then
Do While data_reader.Read()
WorkItemNumber = data_reader.Item("work item number")
Description = data_reader.Item("description")
Loop
End If
data_reader.Close()
data_reader = Nothing
cmd.Dispose()
cmd = Nothing
conn.Close()
conn.Dispose()
End Sub