charan sekhar

charan sekhar

  • NA
  • 108
  • 0

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

Jun 22 2010 2:47 AM

 
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)