c# - asp.net Login database -
Hi IM is a problem when trying to log in to my website. I want it to display the proper message when I keep getting in the same message "email is not correct" but will anyone be able to help me?
Secure void loginbutton_click (Object Sender, EventArgs e) {SqlConnection con = new SqlConnection (ConfigurationManager.ConnectionStrings ["RegConnectionString"] ConnectionString). Con.Open (); String Checker = "Select the number from the user where email = '" + loginmail. Text + ";"; SqlCommand Com = New SQL Commands (Checksier, Conn.); int temp = convert.ToInt32 (com.ExecuteScalar (.) ToString ()); Con.Close (); If (temp == 1) {con.Open (); String check password word = "Choose password from user where email = '" + loginmail. Text + ";"; SqlCommand pass = new SqlCommand (checkPasswordQuery, con); String password = pass.ExecuteScalar (). ToString (); If (password == loginpassword.Text) {session ["new"] = loginmail Text; reaction. Type ("password is correct"); Response.Redirect ("Admin.aspx"); } else {Response.Write ("password is not correct"); }} else {Response.Write ("Email is not correct"); }}
There is a place next to your email:
where email = '"+ log ... to highlight it:
where email =' [an empty place here I have a need to change this: string checksuser = "count (*) Choose user from" log = ... Where email = '"+ loginmail Text + ";";
Comments
Post a Comment