Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
- SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString);
- con.Open();
- string checkuser = "select * from tb_Login where Username='" + txtUsername.Text + "' and Password='" + txtPassword.Text + "' ";
- SqlCommand com = new SqlCommand(checkuser, con);
- int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
- con.Close();
- if (temp == 1)
- {
- con.Open();
- string checkPass = "select Password from tb_Login where Username='" + txtUsername.Text + "'";
- SqlCommand passCom = new SqlCommand(checkPass, con);
- string password = passCom.ExecuteScalar().ToString().Replace(" ", "");
- if (password == txtPassword.Text)
- {
- Session["New"] = txtUsername.Text;
- Response.Write("Correct");
- }
- else
- {
- Response.Write("Not Correct");
- }
- }
- else
- {
- Response.Write("Username not correct");
- }
- string checkuser = "select * from tb_Login where Username='" + txtUsername.Text + "' and Password='" + txtPassword.Text + "' ";
- int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
Add Comment
Please, Sign In to add comment