2
Answers

how to write the querry at the login with user name given but password is null


 
Hi ,
iam using asp.net2.0 with c# with backend sql server 2000.

in my database some user dosent have password (null)
 and some user having password  .when iam checking the user it is giving message invalid user or password.
can you correct my querry which helps me

 
 SqlCommand cmd = new SqlCommand("select * from Usersprogrammer where UserName='" + txtusername.Text + "' and OrPassword='"+txtpassword.Text+"'", con);

 

Answers (2)