4
Answers

Username & pwd verification ?

SUNIL GUTTA

SUNIL GUTTA

11y
823
1
Hi


Is there any way out to verify username and password using sql query to DB ..

Well actually i pre-requisite is i have say many columns i,e password and usernames ... so on 

I used query like this 

cmd = new SqlCommand("select username,password from studentform where username = " '+textbox1.text' and password= " '+textbox2.text ' " ,con); 
        con.Open();
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.Read())
        {
            Server.Transfer("studentafterlogin.aspx");
        }
        else
        {
            Response.Write("<script> alert('Invalid credentials')</script>");
        }

In above in my command , The select statement NOT WORKING PROPERLY i am not getting anything to datareader EVEN i given correct credentials ?? Problem in query ??

Help it please ....

Answers (4)
Next Recommended Forum