Hi all, here is my problem. I wish to do a verification to the login form, so that the userId is match with the password at the database then the user is able to login. i wish to have a nested if statement but somehow the systems return me an error of 1: expression expected, 2. end of statement expected.
i not sure that i have point the query to the database that i had made not. Here is one of the code i had try. If for the vb 6 it may need to declare some ADO database connect, but i not sure that in vb.net is need to do that so or what.
CODE
Dim query2 As String
Dim query As String
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click
Dim userId As String
Dim pass As String
userId = Me.txtloginId.Text
pass = Me.txtpassword.Text
If query = "SELECT * FROM user WHERE userId = '" & userId & " '" and
query = "SELECT * FROM user WHERE password = '" & pass & "'" Then
main.Show()
Else : MessageBox.Show("Wrong User ID")
End If
I'm current developing a system like cashier, once the stock code had choosen it automaticall wiil show the price for the item, what code/function should i refer to??
thanks !