Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 12-Nov-12 1:12am
Comments
ryanb31 at 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 at 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 at 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 at 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)

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100