i have codes for adding data to listview from database but there's a problem ..
Public Sub showmyrecords()
Dim lvi As ListViewItem
Dim dt As New DataTable
Dim ds As New DataSet
' Dim intCount As Integer
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter("Select * from Schedulings where YearLevels = '" & ComboBox3.Text & "' And Sections = '" & ComboBox1.Text & "' ", asconn)
da.Fill(dt)
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strsql
acscmd.Connection = asconn
dr = acscmd.ExecuteReader()
For Each myrow__1 As DataRow In dt.Rows
lvi = New ListViewItem()
lvi.Text = myrow__1(5)
lvi.SubItems.Add(myrow__1(6))
lvi.SubItems.Add(myrow__1(7))
lvi.SubItems.Add(myrow__1(8))
lvi.SubItems.Add(myrow__1(9))
lvi.SubItems.Add(myrow__1(10))
ListView1.Items.Add(lvi)
Next
End Sub
it produces the rigth data but it produces the same data as many as records that satisfies my query...
please.. help me . . i've been searching it in hours but there's no correct output. thank youuuuu in advance. :)