Problem with Login check from SQL DB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • berilker
    New Member
    • Jan 2010
    • 3

    Problem with Login check from SQL DB

    Hi, i have a project which is hospital automation software. I need to set a login screen for users to access different forms according to their access rights. I have a table in my sql database(sql server 2008) with user records, each user has an id no and password in table. I created a login form with id and pass textboxes in it but i dont know how to compare them from database and complete the login action. How can i do that?
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    pass a query to the database something like this...

    select Count(*) from Users where id like 'userid' and password like 'pass'

    and if 1 is returned then the user credentials are valid

    Comment

    • berilker
      New Member
      • Jan 2010
      • 3

      #3
      thank you thatthatguy it worked ;)

      Comment

      Working...