Trying to have the user be able to move alphabetically through a db in .net. The user picks a record from a listview and then:
Once this hurdle is cleared, the data from the next record is displayed.
Any help is appreciated. thanks
Code:
If frm.lvwDisplay.SelectedIndices.Count = 0 Then
Exit Sub
Else
intID = CInt(frm.lvwDisplay.SelectedItems(0).Text)
dataMgr.FindOneName(intID, nMember) 'nMember a class of members
dataMgr.GetAbsRec(iID)
End If
Public Function GetAbsRec(ByVal iMemberID As Integer) As Integer
Dim abspos As Integer
Dim dtr As DataRow
For i = 0 To ds.Tables("Members").Rows.Count - 1 ' this is where it falls apart. 'Object reference not set to an instance of an object.
dtr = ds.Tables("Members").Rows(i)
If dtr.Item("MemberID") = iMemberID Then
abspos = i
End If
Next
Return abspos
Exit Function
End Function
Any help is appreciated. thanks