Definition:
BindingNavigator control Provide user interface with a simple
data navigation and manipulation on the form . it is used for Binding the
Database Tables values to the control (Datagridview,Text Box, label etc.). BindingNavigator with the BindingSource enable
users to move through data records on a form and interact with the records.
There are few buttons
in binding Navigator listed below:
1.
Move First---------------àGo
first record of the table
2.
Move Next---------------àGo
Next record of the table with respect to current record.
3.
Move Previous----------àGo
previous record of the table.
4.
Move Last----------------àGo
Last record of the table.
5.
Delete----------------------àDelete
selected row (record).
6.
Add New--------------------àAdd
New Row.
7.
Tool Strip-------------------àYou
can add button, Label, Image and Textbox etc.
8.
Position Item---------------àcurrent
row count.
9.
Count Item------------------àTotal
Number of rows in database table.
Here
we Bind Binding Navigator with Datagridview
and TextBoxes.You can view the
record in textboxes and datagridview with the help of binding navigator.First
we create database and table and bind control with binding navigator.
Step: 1
Open your visual
studio-->File-->New-->Project-->Windows Forms Application, Drag and
Drop Datagridview, Label, Text Box and Binding Navigator control on the Form
from tool Box as shown below:
Step: 2
·
Now open Microsoft Sql Server Studio
·
Create a table bio and insert into some values.
Step: 3
Expand
DataBindings on the top of the Binding
Navigator Properties Window:
Step: 4
Click Add Project
Data Source which is shown above image.
Step : 5
Now
select Database and click Next Button.
Step: 6
Select Dataset and click
Next button.
Step: 7
Click
on Next Button. Select Table bio and
click on Finish button.
Step: 8
Open your windows Form, Go
properties of id Text Box and Expand DataBindings --> Text --> double
click on column id Now
Doing
same way for Name,Passw and fname also.
Step: 9
Select BindingNavigator control
and goes to its properties window.
Select
bindingSource1.
Step: 10
Run the Application
press F5 ---àOutput
For Datagrid
View:
First Bind the Binding Navigator follow the step 9.
Step1:
·
Select Datagridview
. Now click on smart button on the Right top of the Datagridview.
·
Select Datasource
--àbindingSource1. Press F5 and
View output.
Output:
Comments
Post a Comment