i am trying to read in a list of custmers from northwind database and add
them into a listbox,
the first 20 records add fine, but any records after that are duplicates of
the last record in the query.??
anyone else come across this?
using inTheHand.DLL with the following code:
Dim dr As AdoceDataReader
Dim cmd As New AdoceCommand("SELECT supplierID,companyname from suppliers
ORDER BY CompanyName ASC", conn)
Try
dr = cmd.ExecuteReader()
Dim startRec As Integer
startRec = (pagingNo * val) + 1
Dim c As Integer
c = 0
cboSuppliers.Items.Clear()
ListBox1.Items.Clear()
While dr.Read()
If c = val Then Exit While
ListBox1.Items.Add(dr(1))
cboSuppliers.Items.Add(dr(1))
c = c + 1
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
dr = Nothing
cmd = Nothing
End Try
thanks,
Paul