2
Answers

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

Photo of charan sekhar

charan sekhar

15y
3.4k
1

 
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)