Am trying to move next/previous from a chosen record.
da, ds are dimmed as formwide
Public Sub MoveNext(ByRef sName As String, ByRef iID As Integer)
Dim dr As DataRow
da = New OleDbDataAdapter()
ds = New DataSet()
sName = Replace(sName, “‘”, “””)
cmd = New OleDbCommand(“SELECT * FROM Restaurants WHERE RestName = ‘” & sName & “‘” & _
” ORDER BY RestName”, cn)
da.SelectCommand = cmd
da.Fill(ds, “Restaurants”)
For i As Integer = 0 To ds.Tables(“Restaurants”).Rows.Count – 1 ‘returns current row
cR.RestaurantID = iID ‘cR is a class containing all restaurant info
dr = ds.Tables(“Restaurants”).Rows(0) ‘ dr contains all data in current row
Next
End Sub
Since the data in the current row can be extracted, I struggle with how to move the pointer in the table forward/backward.