Update and AcceptChanges

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

    Update and AcceptChanges

    Hi all
    when I call Update method of SqlDataAdaptor it calls AcceptChanges
    automatically.i s it possible to prevent calling AcceptChanges??
    I know I can use GetChanges method but because in my table the primary key
    is auto number when I merge back the changes, it shows the channges twice in
    DataGrid.
    thanks in advance..


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Update and AcceptChanges

    perspolis,

    The only way I can think of doing this would be to actually copy the
    data set (using GetChanges) and then perform the update on that. You would
    then have to merge the changes back with the original data set.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "perspolis" <rezarms@hotmai l.com> wrote in message
    news:uuNJI9m$FH A.264@tk2msftng p13.phx.gbl...[color=blue]
    > Hi all
    > when I call Update method of SqlDataAdaptor it calls AcceptChanges
    > automatically.i s it possible to prevent calling AcceptChanges??
    > I know I can use GetChanges method but because in my table the primary key
    > is auto number when I merge back the changes, it shows the channges twice
    > in
    > DataGrid.
    > thanks in advance..
    >
    >[/color]


    Comment

    Working...