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

Recommended Answers

All 2 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.