0

need to check an SQL Server database (not asp.net membership) to see if an email is already in use before allowing the user to register.

I have tried using the information in this website but it does not seem to work.

Your help will be much appreciated

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Sarama2030
0

What exactly are you having trouble with?
All you need to do is query the database for the email entered and see if it returns 0 or 1 (0 = not in database, 1 = email exists).
If you have already coded part of the problem show it here and we can direct you on what you are missing.

0

when the user enters the e-mail address for registration you can verify that it exists by:

-If the e-mail address is the primary key in the table the dbms will return an error for duplicate keys if you try to save it.You can trap this error if you have trapped all the other possible errors using a try.. catch statement and inform the user that their e-mail already exists or is taken.

-If the e-mail address is not the primary key, you can select all the e-mail addresses from the table and match them with the entered one using a dataset and a for....next loop.If the e-mail is found trap the error, else proceed to do whatever.Hope this helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.