locked
DataSet.AcceptChanges() doesn't accept all the changes! RRS feed

  • Question

  • Hi,

    When I do a dataset.AcceptChanges there's always one table that I must additionally accept the changes befora all my changes are accepted.

    dataset.AcceptChanges()
    dataset.tableX.AcceptChanges()

    There are no errors in the dataset.
    Does anybody know why ?

    Thanks,
    Filip
    Tuesday, June 7, 2005 1:07 PM

Answers

  • I understand that after invoking DataSet.AcceptChanges90 you are still seeing atleast 1 table which has 1 or more changes. We tried to reproduce this at our end but were unable to do so.

    DataTable.AcceptChanges() accepts changes on rows that exist in its Rows collection at the begining of AcceptChanges.
    i.e. event handlers could possibly add new rows or modifiy existing already processed rows.
     
    DataSet.AcceptChanges will call DataTable.AcceptChanges in the order they appear it the DataSet.Tables collection .  If tables get reordered/added/removed it is possible for a table to have accept changes called twice or not at all.

    Is it possible that there is some code in EventHandlers thats causing rows to get modified for this behavior to manifest?

    Thanks,
    Kawarjit Bedi
    Program Manager ADO.NET
    kbedi@microsoft.com

    Wednesday, October 19, 2005 7:43 PM

All replies

  • Hi,

    When I do an update of this table with the TableAdapter. I get an 'Internal index is corrupted: '5' exception. Does anybody know what this means?

    Thanks,
    Filip
    Wednesday, June 8, 2005 9:27 AM
  • can you post the code? other then the acceptchanges ?
    Wednesday, June 8, 2005 2:24 PM
  • I understand that after invoking DataSet.AcceptChanges90 you are still seeing atleast 1 table which has 1 or more changes. We tried to reproduce this at our end but were unable to do so.

    DataTable.AcceptChanges() accepts changes on rows that exist in its Rows collection at the begining of AcceptChanges.
    i.e. event handlers could possibly add new rows or modifiy existing already processed rows.
     
    DataSet.AcceptChanges will call DataTable.AcceptChanges in the order they appear it the DataSet.Tables collection .  If tables get reordered/added/removed it is possible for a table to have accept changes called twice or not at all.

    Is it possible that there is some code in EventHandlers thats causing rows to get modified for this behavior to manifest?

    Thanks,
    Kawarjit Bedi
    Program Manager ADO.NET
    kbedi@microsoft.com

    Wednesday, October 19, 2005 7:43 PM