how does SqlCommandBuilder maintain a row's key value

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

    how does SqlCommandBuilder maintain a row's key value

    Hi,

    The SqlCommandBuild er class seems to be able to remember
    the primary key of a row such that even if I change that
    key's value, it is still able to update only that row.
    So I would like to know how can I update a row even when
    the primary key is changed by the user? From the row's
    columns' information the original information seems to be
    lost so that I can specify to update only the row with
    the original primary key.

    Thanks for anyone's advise!
  • William Ryan

    #2
    Re: how does SqlCommandBuild er maintain a row's key value

    The DataAdapter has a Diffgram that shows before and after values, actually
    it's the dataset that has it, not the Adapter. So if you had a value of 1
    in CustomerID for instance and you change it to 2, the effective query would
    be Update MyTable Set CustomerID = 2 where CustomerID =1.
    "Nick" <ykuang@usc.edu > wrote in message
    news:02a801c3a0 53$393796e0$a00 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > The SqlCommandBuild er class seems to be able to remember
    > the primary key of a row such that even if I change that
    > key's value, it is still able to update only that row.
    > So I would like to know how can I update a row even when
    > the primary key is changed by the user? From the row's
    > columns' information the original information seems to be
    > lost so that I can specify to update only the row with
    > the original primary key.
    >
    > Thanks for anyone's advise![/color]


    Comment

    Working...