0

i have made a simple login page with 2 textboxes for username and password and a button to login.
the usernames and passwords are in an sql database . how would i go about retrieving the username and password from the database.
i have tried a select where statement

If TxtUsername.Text = "" And TxtPassword.Text = "" Then
MessageBox.Show("Please enter username and password")

ElseIf TxtUsername.Text = "" Then

MessageBox.Show("Please enter username")
ElseIf TxtPassword.Text = "" Then

MessageBox.Show("Please enter Password")

ElseIf SqlDataAdapter1.SelectCommand.CommandText "SELECT * FROM Managers WHERE managerID = '+ TxtUsername.Text +' and password = '+ txtPassword.text+ " Then
FrmManView.Show() .
but this does not appear to do anything, what am i doing wrong? i am a beginner so any help will be appreciated thanks

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

ElseIf SqlDataAdapter1.SelectCommand.CommandText "SELECT * FROM Managers WHERE managerID = '+ TxtUsername.Text +' and password = '+ txtPassword.text+ " Then
FrmManView.Show()

you not checked input just select data from input.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.