update sql unique key with dataadapter

Discussion in 'ASP .Net Datagrid Control' started by luudt, Nov 14, 2003.

  1. luudt

    luudt Guest

    I got a typed dataset of data from a Sql server and i binded them on a
    grid, then if the user edit the grid all changes will be sent back
    throw dataadapter.update.
    The problem is that there is a unique key with three records and if
    the user edit manually it switching values in the following way for
    example:

    original Intermediate editing final result
    a ax ax ax ax b first record
    b b bx bx c c second record
    c c c a a a third reccord

    The typed dataset will let him this editing but then when it'll update
    obviusly the sql server'll give back instead an error about attemptig
    of writing an already present unique key

    How can i update avoiding this error?
     
    luudt, Nov 14, 2003
    #1
    1. Advertising

  2. luudt

    Rajesh Patel Guest

    you decide, if this is required by system or this is outcome of some user's
    play. or this is you want to test for your module.

    in every case, you should make this unique column readonly in the grid.

    and if you need to interchange the values of unique key anyhow. you need to
    provide another interface for interchanging values of unique column.


    Regards,

    Rajesh Patel


    "luudt" <> wrote in message
    news:...
    > I got a typed dataset of data from a Sql server and i binded them on a
    > grid, then if the user edit the grid all changes will be sent back
    > throw dataadapter.update.
    > The problem is that there is a unique key with three records and if
    > the user edit manually it switching values in the following way for
    > example:
    >
    > original Intermediate editing final result
    > a ax ax ax ax b first record
    > b b bx bx c c second record
    > c c c a a a third reccord
    >
    > The typed dataset will let him this editing but then when it'll update
    > obviusly the sql server'll give back instead an error about attemptig
    > of writing an already present unique key
    >
    > How can i update avoiding this error?
     
    Rajesh Patel, Nov 14, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Galen Harris

    dataadapter.update -- dataset from session

    Galen Harris, Oct 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    545
    Jacob Yang [MSFT]
    Oct 24, 2003
  2. Galen Harris
    Replies:
    1
    Views:
    470
    Patrik Löwendahl
    Oct 24, 2003
  3. Elmo

    DataAdapter/Update problem

    Elmo, Nov 8, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    4,027
  4. Guest

    DataAdapter and Update method

    Guest, Dec 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    331
    Guest
    Dec 2, 2003
  5. Biggie
    Replies:
    1
    Views:
    3,647
    Alvin Bruney [MVP]
    Feb 6, 2004
Loading...

Share This Page