Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!!
I have a datagridview on my winform in which i m populating the records of a table from ms access database. I want the datagridview to be editable , so i enabled editing of datagridview. But the changes made to gridview cell or row are not saved in database, hence when i run the application again it doesn't shows the edited records in datagridview.

How can i make datagrid view to be editable and after editing records must be saved in database.

Thanks
Posted

Look this CodeProject [^]article
 
Share this answer
 
Comments
RaviRanjanKr 4-May-11 1:58am    
Nice Link,My 5 :)
Wonde Tadesse 21-May-11 23:11pm    
Thanks RaviRanjankr.
simply use:

OleDbCommandBuilder build = new OleDbCommandBuilder(adapter);

for building the upadate query and on save record button click event write the below line:
adapter.Update(dt);

where adapter is a object of OleDbDataAdapter and dt is object of DataTable

Thanks.
 
Share this answer
 
v3
 
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