Click here to Skip to main content
16,011,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello i have a webform that user enter's data and data are saved in sql database by a click of a button.The form has some textbox,dropdoun menus,and radiobuttons.
I want to put in my form something like a search function when entering the value in primary key textbox (that is a car registration number and it is unique) if already exist then autoinsert in fields all data in form from database for update reasons, if not then i will do a normal insert and save.

Thanks in advance

Nicolas

ps sorry about my terrible english.
Posted
Comments
ZurdoDev 12-Nov-12 8:41am    
I am not sure I understand you but it sounds like you want to insert the record if it does not exist otherwise update? If so, in your SQL use the EXISTS keyword. IF EXSIST (SELECT * FROM table WHERE ID = @ID) BEGIN -- do the update END ELSE BEGIN -- do the insert -- END
joshrduncan2012 12-Nov-12 12:10pm    
I think you are looking for AutoComplete and AutoSuggest. If so, Visual Studio can provide property settings for you. If you type something in and it's already in there, it will autofill for you, is this what you are looking for?
nikolas_ar 12-Nov-12 15:29pm    
Yes but i want by typing something in the textbox must autofill all fields from the specific record.Its possible?
An example it would be a good help.
Thanks
Nicolas
joshrduncan2012 12-Nov-12 15:37pm    
Unless I'm missing something, I am reiterating setting AutoComplete and AutoSuggest for the textboxes to be enabled. I can't decipher anything else from what you are telling me.

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