in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Merge then Update Problem/Question

Last post 02-27-2008 1:53 PM by rlindsey. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-26-2008 3:41 PM

    Merge then Update Problem/Question

    I have a problem with the Merge method and it only happens in a very specific set of steps. Here are the steps to cause the problem:

    1. Create two C1DataSet(s), call them dsA and dsB that are identical

    2. Add several rows to dsA.Tables("tblA")

    3. Call dsB.StorageDataset.Tables("tblA").Merge(dsA.StorageDataset.Tables("tblA"), False)

    4. Execute dsA.AcceptChanges()

    4. Now delete one of the rows you added in step #2 above.

    5. Call dsB.StorageDataset.Tables("tblA").Merge(dsA.StorageDataset.Tables("tblA"), False)

     At this point you can look at the rows, and RowState(s) of the rows returned by dsA.StorageDataset.Tables("tblA").GetChanges. Everything looks fine.

    When you call dsB.Update no inserts, deletes, or updates are sent to the SQL Server. If I re-create dsA it the new rows will not have made it to the table.

    I sure hope there is a work-around for this issue. It is a show stopper for our project.

     

  • 02-26-2008 5:38 PM In reply to

    Re: Merge then Update Problem/Question

    Hi,

    It seems to me you are mixing up two different things - trying to update
    a C1DataSet after merging its internal tables using ADO.NET. The
    StorageDataSet is not the only part of the C1DataSet. When you merge
    some tables in the StorageDataSet the other parts of C1DataSet are
    not aware of it.

    Please read the "Working with ADO.NET Dataset" section in the help
    file to C1DataObjects. You should probably use methods like
    StorageChangeBegin, StorageChanged, and StorageChangeEnd of
    the C1DataSet class to synchronize low-level (ADO.NET) changes
    with other parts of the C1DataSet.

    Regards,

    -Andrey
  • 02-27-2008 1:53 PM In reply to

    Re: Merge then Update Problem/Question

    That got me on the right track. Thank you.

    Knowledge is a powerful thing in the hands of the right people.

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.