Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I wanna use same button for e.g. Button1 for both adding and updating a record. Adding record is direct but updating record should happen when i select any item from a listbox and click Reset button i should be able to edit the fields in the same page and when i click same Add button it should be updated to the database.

Thanks & Regards..
Posted
Comments
Sunasara Imdadhusen 19-Nov-10 4:21am    
in ASP.Net?

Many ways you can do it. You can use a Flag boolean variable when you click edit button mark the Flag variable is true. if then update. Or you check in database that the record is already in database if yes then update.

Thanks
 
Share this answer
 
Here's a suggestion from Mycroft:

Combining Insert/Update to one Procedure[^]
 
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