Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Page_Load(object sender, EventArgs e)
- {
- lb_Fail.Visible = false;
- }
- protected void btn_Login_Click(object sender, EventArgs e)
- {
- // connecion to the database
- SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Fasthosts_MMConnectionString"].ConnectionString);
- SqlDataAdapter sda = new SqlDataAdapter("SELECT COUNT(*) FROM Fasthosts_Registration_MM WHERE username='" + tb_UsernameLogin.Text + "' AND password='" + tb_PasswordLogin.Text + "'", conn);
- /* in above line the program is selecting the whole data from table and the matching it with the user name and password provided by user. */
- DataTable dt = new DataTable(); //this is creating a virtual table
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- Response.Redirect("Domains.aspx");
- }
- else
- {
- lb_Fail.Text = ("Incorrect login details");
- lb_Fail.Visible = true;
- }
- }
Add Comment
Please, Sign In to add comment