DataSet.AcceptChanges?

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

    #1

    DataSet.AcceptChanges?

    I can't get this method to work as I expect it to. If I edit a row within a
    DataSet, then invoke the DA's Update, the changes to the current row are
    lost. If I move off the modified row then invoke Update the changes are
    written to the back end. I assumed that AcceptChanges would cause any
    changes in the current row to be included in the Update process, but those
    changes are still being lost.

    How do I ensure that the current rows changes will be included in the DA's
    Update call?


  • Jon Skeet [C# MVP]

    #2
    Re: DataSet.AcceptC hanges?

    Christopher Weaver <we.aver@verizo n.net> wrote:[color=blue]
    > I can't get this method to work as I expect it to. If I edit a row within a
    > DataSet, then invoke the DA's Update, the changes to the current row are
    > lost. If I move off the modified row then invoke Update the changes are
    > written to the back end. I assumed that AcceptChanges would cause any
    > changes in the current row to be included in the Update process, but those
    > changes are still being lost.[/color]

    No, quite the opposite. AcceptChanges is used to tell the DataSet that
    all the modifications have been successfully accepted. Don't call
    AcceptChanges manually and everything should be okay.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Christopher Weaver

      #3
      Re: DataSet.AcceptC hanges?

      So how do I tell the DataSet to include the current row's changes in the
      Update process? Unless I move off the row they are lost.


      "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
      news:MPG.1cf842 81fa26619598c16 0@msnews.micros oft.com...[color=blue]
      > Christopher Weaver <we.aver@verizo n.net> wrote:[color=green]
      >> I can't get this method to work as I expect it to. If I edit a row
      >> within a
      >> DataSet, then invoke the DA's Update, the changes to the current row are
      >> lost. If I move off the modified row then invoke Update the changes are
      >> written to the back end. I assumed that AcceptChanges would cause any
      >> changes in the current row to be included in the Update process, but
      >> those
      >> changes are still being lost.[/color]
      >
      > No, quite the opposite. AcceptChanges is used to tell the DataSet that
      > all the modifications have been successfully accepted. Don't call
      > AcceptChanges manually and everything should be okay.
      >
      > --
      > Jon Skeet - <skeet@pobox.co m>
      > http://www.pobox.com/~skeet
      > If replying to the group, please do not mail me too[/color]


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: DataSet.AcceptC hanges?

        Christopher Weaver <we.aver@verizo n.net> wrote:[color=blue]
        > So how do I tell the DataSet to include the current row's changes in the
        > Update process? Unless I move off the row they are lost.[/color]

        IIRC, you call EndEdit on the row. You should probably ask on the
        adonet newsgroup though - it's a while since I've done data binding.

        --
        Jon Skeet - <skeet@pobox.co m>
        Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

        If replying to the group, please do not mail me too

        Comment

        • Christopher Weaver

          #5
          Re: DataSet.AcceptC hanges?

          I'll look into it. Thanks.


          "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
          news:MPG.1cf854 b1ac97caa898c16 3@msnews.micros oft.com...[color=blue]
          > Christopher Weaver <we.aver@verizo n.net> wrote:[color=green]
          >> So how do I tell the DataSet to include the current row's changes in the
          >> Update process? Unless I move off the row they are lost.[/color]
          >
          > IIRC, you call EndEdit on the row. You should probably ask on the
          > adonet newsgroup though - it's a while since I've done data binding.
          >
          > --
          > Jon Skeet - <skeet@pobox.co m>
          > http://www.pobox.com/~skeet
          > If replying to the group, please do not mail me too[/color]


          Comment

          Working...