

'We move back only if we're not at the first row.

To call this method from the btnPrevious click event, for example, Instead of filling the textboxes individually each time, you’ll call a single method, FillFields(), which looks at the intCurrentIndex variable and fills up the textboxes.ĭs.Tables(0).Rows(intCurrentIndex).Item("FirstName").ToString()ĭs.Tables(0).Rows(intCurrentIndex).Item("LastName").ToString()ĭs.Tables(0).Rows(intCurrentIndex).Item("Location").ToString() The code for Form Load, btnFirst, btnPrevious, btnNext, and btnLast is almost the same as in the form presented in Part 1, but with a few small differences. Don’t forget to go into Project properties and set this new form (Form2) as the startup object. Add three more buttons: btnAdd, btnUpdate, and btnDelete.

Your form should have the same labels, textboxes, and buttons. Start by creating another form, just like you did in Part 1. In this tutorial, you will do even more with ADO.NET in Visual Basic.NET. This tutorial continues where the first tutorial, “ A Basic ADO.NET Tutorial in Visual Basic.
