update sql unique key with dataadapter

  • Thread starter Thread starter luudt
  • Start date Start date
L

luudt

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?
 
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
 
Back
Top