Also see How to: Bind Data to the Windows Forms Data Grid View Control Using the Designer.For information about building this example from the command line for Visual Basic or Visual C#, see Building from the Command Line (Visual Basic) or Command-line Building With
Updating database table datagridview
In most circumstances, however, you will bind to a Binding Source component which will manage the details of interacting with the data source.
The Binding Source component can represent any Windows Forms data source and gives you great flexibility when choosing or modifying the location of your data.
The Data Grid View control can display rows of data from a data source.
The Data Grid View can display data in Bound mode, unbound mode and Virtual mode .
Thus i have my datagridview as student Id , student Name , Update student Id is the primary key and auto increments. But for Update the changes were not reflected in the tables, although the value in the dataset was changing.
The Data Grid View control supports the standard Windows Forms data binding model, so it will bind to a variety of data sources.
I can populate the Data Grid View without a problem.
I can even insert/update it without issue if I run the update code from a click event of a button.
But I am facing a problem for update statements for this code. Update() is not working when i want to update contents of a row. Update(dataset, "Student") returns 0 ; Also I have tried populating student Id in the dataset along with the student Name yet the changes werent reflected.