Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to edit and save on datagridview?

I am using ms access database. Now tables retrieve from the database through the datagridview. here after i want edit on datagridview and save changes to the database how is it?

pls tel me. i am waiting for your response.
Posted

Dataset is the main part in all your operations.

1. Fetch the values in dataset from database.
2. Bind it with gridview. Put gridview editable (so user edit values whatever
they want)
3. after editing put gridview table to dataaset.
4. finally update dataset to database.

Gridview changes to dataset.

C#
DataTable dt = (DataTable)GridView1.DataSource; 
 Dataset ds = new dataSet;
 ds.tables[0] =  dt


and then Save Dataset Changes to a Database[^]
 
Share this answer
 
 
Share this answer
 
This Question was asked some time ago:
datagrid view in .net[^]
 
Share this answer
 
Refer this link:

datagrid view in .net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900