0

Hi

im working on views that can help me navigate through records in a table. i have managed to execute an sql string to select the table i.e "select * from Users"
i however want to build a "Previous" and "Next" command on the view but im mixed up on the navigation

this is what i have:

Private Sub viewusers_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conn.Open()
        userstring = "select * from Users"
        usercmd = New SqlCommand(userstring, conn)
        usercmd.ExecuteReader()


End Sub

Now all i need is code for going forward or backwards to a record. Some help please.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by AndreRet
0

To move to the next record -

usercmd.NextResult()

To move to the previous record -

usercmd.MovePrevious()

Also, have a look at THIS link.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.