Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
example records in my tables (view in gridview)

POSITION         LASTNAME

CHAIRMAN        REYES
MEMBER          LUNA
MEMBER          MARTINEZ

ADD BUTTON
EDIT BUTTON


When I edit the chairman, I can't save it because of the validation, that there must be only one chairman in the field shows it.

How can I save this, that he is still the chairman?

Thanks!
Posted
Updated 20-Feb-11 22:01pm
v3
Comments
Prerak Patel 21-Feb-11 1:02am    
Question is not clear.
[no name] 21-Feb-11 1:16am    
Be Speciifc, What is your problem?
sevengenn 21-Feb-11 1:24am    
prerak patel && ramaling koushik, sorry guys. I'm having a hard tome explaining my problem. but I tried to improve it. thanks
Ankur\m/ 21-Feb-11 1:52am    
When you say you edit the chairman, are you only editing his name? What validation have you done? Can you show the code?
Dalek Dave 21-Feb-11 4:01am    
Edited for Readability.

1 solution

In the validation check you need to include one more condition that if the current record is the previous existing one itslef then ignore.

Generally at DB level, this is handled via a key.
At UI level, you can store the current chairman. When editing and updating, just compare and see if the one editing is of current chairman or not - if so, don't put the duplicate check and just move ahead.

Bottom line, you need to keep track of current chairman and accordingly handle the validation part.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900