Comparing two datasets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jacew

    #1

    Comparing two datasets

    I want to compare two datasets and retireive the differences. Is the an easy
    way to do this without trawling through the all records and fields?
    The basic problem is this. I get a dataset and copy it. I then load the data
    into a web form. The user then makes any changes to the form. when he saves
    the form data all the fields are written back to the dataset whether there
    have been any changes or not. I then want to compare this saved dataset with
    the original one and see if any fields have actually changed. Unfortunately
    the GetChanges method fires when you assign a value to a field even if the
    new value is identical to the old one.
    T.I.A
    Jason
  • JP

    #2
    RE: Comparing two datasets

    try out Haschanges method of a dataset , else you you can also identify
    rowstate to get the state of DataRows modified, deleted,created or inserted .

    other option is that you can use DataRowVersion and can get Current ,
    Default , Original and proposed values and make comparison between Current
    and Original versions .

    ---JP


    "jacew" wrote:
    [color=blue]
    > I want to compare two datasets and retireive the differences. Is the an easy
    > way to do this without trawling through the all records and fields?
    > The basic problem is this. I get a dataset and copy it. I then load the data
    > into a web form. The user then makes any changes to the form. when he saves
    > the form data all the fields are written back to the dataset whether there
    > have been any changes or not. I then want to compare this saved dataset with
    > the original one and see if any fields have actually changed. Unfortunately
    > the GetChanges method fires when you assign a value to a field even if the
    > new value is identical to the old one.
    > T.I.A
    > Jason[/color]

    Comment

    Working...