Sunday, 14 October 2012

Matching login Id & Password 



if (cn.State == ConnectionState.Open)
        {
            cn.Close();
        }
        cn.Open();
        cmd = new SqlCommand("SELECT * FROM Student_Recode sr,User_login ul where sr.EmailID='"+ txtemail.Text +"' and ul.Password='"+ txtpass.Text.Trim() +"' and  sr.S_No=ul.S_N and ul.login_Id=sr.EmailID ", cn);
        dr = cmd.ExecuteReader();
        if (dr.HasRows == true)
        {
            Response.Redirect("userinfo.aspx");
            return;
        }
        else
        {
            lblerror.Text = "Sorry User ID And Password Not Corect";
            return;
        }



No comments:

Post a Comment