ahmm, please help me. I want to update the items in listview when my form loads up.
this is my code for the listview. It actually displays the data on the database but when
i add another data it wont appear on the listview.
please help me guys. I'll appreciate it much.
im using vb.net 2005
Sub list()
con.Open()
cmd = New OleDbCommand("select * from employee", con)
conreader = cmd.ExecuteReader()
Me.ListView2.Items.Clear()
Dim lv As ListViewItem
Do While conreader.Read
lv = Me.ListView2.Items.Add(conreader.Item("empno"))
lv.SubItems.Add(conreader.Item("fname"))
lv.SubItems.Add(conreader.Item("middle"))
lv.SubItems.Add(conreader.Item("lname"))
lv.SubItems.Add(conreader.Item("age"))
lv.SubItems.Add(conreader.Item("address"))
lv.SubItems.Add(conreader.Item("datereg"))
lv.SubItems.Add(conreader.Item("fullname"))
Loop
cmd.Dispose()
con.Close()