O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Navigation Procedure

Next let’s fill in the code for the NavButtons event procedure. The code appears as follows:

 Private Sub NavButtons(ByVal sender As Object, ByVal e As EventArgs) Dim intNewRow As Integer Try Me.ParentForm.BindingContext(mDataSet, _ mintBoundTable).EndCurrentEdit() intNewRow = Me.ParentForm.BindingContext(Me).Position Select Case CType(sender, Button).Name Case "cmdFirst" intNewRow = 0 Case "cmdPrevious" If intNewRow > 1 Then itNewRow -= 1 Else intNewRow = 0 End If Case "cmdNext" If intNewRow < _ mDataSet.Tables(mintBoundTable).Rows.Count - 1 Then intNewRow += 1 Else intNewRow = _ mDataSet.Tables(mintBoundTable).Rows.Count - 1 End If Case "cmdLast" intNewRow = mDataSet.Tables(mintBoundTable).Rows.Count - 1 End Select ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required