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.

To move to the next record -

usercmd.NextResult()

To move to the previous record -

usercmd.MovePrevious()

Also, have a look at THIS link.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.