Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I have a database and it has a table where the data field name is "UserID" . I want to get the value of "1" in UserID for me to use it in if else condition. I dont really know how to code it and found nothing in the google that match my problem. Thanks.

What I have tried:

dr=(Select * from tblLogin where UserId "1)
dr=Execute.Reader
If dr. Read = True Then
me. hide()
Form2.show
Posted
Updated 17-Dec-16 17:56pm

1 solution

I have found it for you, Retrieving Data Using a DataReader[^]
 
Share this answer
 
Comments
Member 12905345 17-Dec-16 23:56pm    
I didnt find if the value of UserID could get and use it in if else condition
Peter Leow 18-Dec-16 0:00am    
You are not writing the SQL statement correctly, refer http://www.w3schools.com/sql/sql_where.asp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900