BindingNavigator in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

BindingNavigator is used to navigate between data records.

BindingNavigator

BindingNavigator provides buttons to the user to add, save, delete, go forward, go backword, etc...


Notice that BindingNavigator consists of controls like buttons, labels, and textboxes. You can add, remove or adjust properties of each control by right clicking on each one.
When you add a BindingNavigator, it appears in the bottom grey are of the designer page:

Example:
In this example we will use a BindingNavigator to control a datasource that is connected to Access database.
Create access database that contains Emails table:
Add 2 fields: Name and Email

Connect Emails database to a visual basic program:

Open Data Sources and click on the highlighted icon above (Add New Data Source)

Next

Click on Dataset then Next

Click on New Connection...

Then click on Microsoft Access Database File, then Continue

Click on Browse, then browse to Emails database you created.

Then click Open, then Ok, and then Next.

You will get a message asking you if you want to copy the database to your project. Click No to keep using your local database.

Click Next

Check Tables, then click Finish.

Now add 2 textboxes, a BindingNavigator to a form:

Add a BindingSource from the Toolbox, then adjust its DataSource property to

EmailDataSet

Then click on BindingNavigator and adjust its BindingSource to BindingSource1

Now go to each textbox you created and adjust their DataBinding properties to Name for TextBox1, and Email for TextBox2

Now run the program and you should be able to navigate using the controls on BindingNavigator


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.