Data Tier Application Development with VB.NET Part 1

Page 4

 

Now you will have to code your datatier. You will need a reference to the authorsTableAdapter and the dataset. You will have to code a getDataSet method which will instantiate the references, fill the dataset and return the dataset.

On the form put labels, textboxes and two buttons. The textboxes will display the firstname and lastname. The buttons will let you move to the next or previous record in the table. Name the components appropriately, for ex. textbox for the firstname as txtFirstName.

Next step is to code for the form. The form will need references to your datatier, dataset and a bindingsource. In the form_load event you will need to instantiate your datatier and call the getDataSet method which you coded previously. Then setup the bindingsource and bind the text fields.

Next step is to code for the Previous and Next buttons. The buttons simply increase or decrease the binding position.

You can now run the application and test it. I will let you add a textbox for genre yourself as practice.

 

I hope you found this tutorial helpful.

-Steve O.

 

EOF