The chapter assumes that you have Microsoft Access installed together with the North Wind sample Access database.
This can usually be found in Program Files\Microsoft Office\Officenn\Samples\(where nn signifies your version of Microsoft Office).
The Visual Basic Data Grid View control provides a table in which rows and columns from a database table can be displayed and modified.
If the Data Sources panel is not visible, select the Data-Show Data Sources menu option.
Once visible, click and drag the Customers table from the Data Sources panel over the Data Grid View control on the form. Press F5 to build and run the application: It is important to realize that when changes are made in a Data Grid View control the changes are only made to the Data Set and are not written back to the database.
The examples in this chapter work with a Microsoft Access database.
The concepts covered, however, apply equally to other databases such as Microsoft SQL Server.
The Add Connection dialog will appear as follows: Change the Data source field to Microsoft Access Database if necessary.
Click on the Browse button and locate the database.
Access the Toolbox and drag and drop the Data Grid View control onto the form.
Resize the control so that fills the entire form and set the Anchor property in the Properties panel so that all sides are anchored (such that when the form is resized the Data Grid View will also resize).
When user clicked "Edit" button he should allowed to make changes in "Datagridview".
After making changes in "Datagridview" when user clicked "Save" button, whichever changes made in datagridview should get reflect at backend in table "Emp Details". Tables; //now u can save changes to back end with da.
For ex: I am having "Datagridview", "Edit" and "Save" button on Win Form and table "Emp Details" at backend in databse.