Subject: sql statement
Posted By: sand133 Post Date: 6/26/2004 8:21:50 AM
hi i want to create a sql statement that gets all records from a table (admin) where the username = (what the user typed in, into the text box) and password = (what the user typed in, into the text box)

so far i have managed to come up with this, i dont know whether this is correct becuase when i debug i find my datareader object is empty

"Select * From admin Where password=? and username=?"
many thanks


Reply By: abdusalam Reply Date: 6/26/2004 9:24:07 AM

select * from admin where userid ='" & txtuser.text & "'" And password = '" & pass.text & "'"

hope it will help you...

Stay Beautiful,
Abdul Salam
Reply By: Lalit_Pratihari Reply Date: 9/29/2004 9:48:16 AM
Hi,

Just a little addition:

Do remember to trim the value in the text boxes and add the single quotes if the datatype is of character type.

SELECT * FROM ADMIN WHERE USERID = '" & Trim(txtuser.text) & "'" AND PASSWORD = '" & Trim(pass.text) & "'"

Thanks,

Lalit
Life Means More...

Go to topic 19583

Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754
Return to index page 753
Return to index page 752
Return to index page 751