Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionStringRegga"].ConnectionString);
- con.Open();
- string checkUser = "select count(*)from Regga where Anvandare='" + UserBox.Text + "'";
- SqlCommand com = new SqlCommand(checkUser, con);
- int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
- con.Close();
- if (temp == 1)
- {
- con.Open();
- string checkPasswordQuery = "select Losenord from Regga where Anvandare='" + UserBox.Text + "'";
- SqlCommand passCom = new SqlCommand(checkPasswordQuery, con);
- string password = passCom.ExecuteScalar().ToString().Replace(" ","");
- if (password == PassBox.Text)
- {
- Session["New"] = UserBox.Text;
- Response.Redirect("MinSida.aspx");
- }
- else
- {
- Response.Write("Fel lösenord");
- }
- con.Close();
- }
- else
- {
- Response.Write("Fel användarnamn");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement