Last post May 15, 2014 02:23 AM by Mikesdotnetting
May 14, 2014 09:40 PM|Benjaminsh|LINK
I have table in SQL Server which has two columns that must be unique (Email Address, and Username), I am traying to find a way to handle their uniqueness seprately.
What I mean is if a user wants to register and key in an email address which is NOT existed,but a username which is EXISTED, How to prompt to user that he/she has to enter a new Username?
May 15, 2014 02:23 AM|Mikesdotnetting|LINK
I can think of a number of ways:
1. Fire AJAX requests for each value and test them separately
2. Try to insert both values and pick the Exception message for details on which one is already in there
2. Create a stored procedure that tests each value individually and returns a formatted message if either are already present
My preference is to have an AJAX request wired up to the change event of the form field and to let the user know if they need to change the supplied value before they submit the form.