Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to disable the autocommit in the datagridview??
and where can i find the insert command??
Posted
Comments
Sandeep Mewara 21-Nov-10 9:23am    
What do you mean by 'autocommit'? Your question is not quite clear.
Rami101 21-Nov-10 11:23am    
i mean when u edit the datagridview ( by adding new row)i don't want it to add the new row to the dataset nor the database until i click save!!!
hope you got the idea:)

1 solution

You can't disable this. Once you bind a DGV to a datasource, all changes are made to the datasource. In you're case, a DataSet. Changes are NOT commited to the backing Database until you tell it to.

Now, the DataSet/Table classes maintain a list of changes that were made to the object as well as the original values when the Set/Table was Filled. So, if you want to abandon changes, you just need to call RejectChanges on the DataSet/Table.
 
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