Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
810
Why does DataSet.GetChanges returns all tables when only 3 were modified?
posted

I have a reasonably complicated database with 18 tables that I load into a dataset and then call AcceptChanges to make sure I am at a neutral position. I then give the DataSet to the UltraGrid via a BindingSource,  go into update mode and delete one row for a table that should only affect two other linked tables. I have established many relationships between the tables but this table only has 2 relationships.

To post the data back to the database, I call DataSet.GetChanges hoping to be efficient but I get all 18 tables back albeit many have 0 or 1 row in them. I am not able to update the database unless I update every table as skipping the ones that have 0 rows causes a concurrency violation. Can anyone shed any light on why I get all my tables when calling GetChanges when only 3 should be affected? Or the proper technique after the grid touches the dataset in order to get only the ones that I really have to update? This has me stumped. Thanks, Dave