update sql unique key with dataadapter

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?
 
R

Rajesh Patel

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top