SELECT Username, [Password] FROM Users WHERE (Username = '@Username') AND ([Password] = '@[Password]')
When I call the query in code, it won't accept the arguments from the username and password text boxes to check them against my Username and Password fields from the 'Users' database. Can anyone point me in the right direction as to what I might be doing wrong? Thanks!
Public Class LoginForm1
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Try
' This line is giving the error:
Me.UsersTableAdapter.Login(UsernameTextBox.Text, PasswordTextBox.Text)
Me.Close()
Catch ex As Exception
MsgBox("Invalid Username or Password", MsgBoxStyle.Exclamation, "Validation Failed")
PasswordTextBox.Text = String.Empty
PasswordTextBox.Focus()
End Try
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
AboutBox1.Hide()
MainMenu.Close()
End Sub
Private Sub LoginForm1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.UsersTableAdapter.Fill(EmployeesDataSet.Users)
End Sub
End Class

New Topic/Question
Reply




MultiQuote






|