I am creating a registration page and want to be able to take the username and password that the user entered and check to the the database to make sure it doesn't already exist. If it does I want to return an error Response.Write() message and if it doesnt then I will continue with my other code. I am very new to this and it's hard finding some support forums online that are what I need.
This is what I have so far:
Expand|Select|Wrap|Line Numbers
- SqlConnection myConn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=\"C:\\Program Files\\MyProject\\App_Data\\Database.mdf\";Integrated Security=True;Connect Timeout=30;User Instance=True");
- SqlCommand cmdCheck = new SqlCommand("SELECT 1 AS [EXIST] FROM Users WHERE Email = '" + email.Text + "' AND IsActive = 'True'", myConn);
Thanks