Please i'm developing an application with vb.net and mysql. I want to add additional users to the application but with different access levels. this is my original code
sql = "select username, password from users where (username = '" & UsernameTextBox.Text & "') and (password = '" & PasswordTextBox.Text & "')"
conn.ConnectionString = "server=localhost;" _
& "database=cargomanager;" _
& "userid=root;" _
& "password=admin;"
Try
conn.Open()
Catch myerror As MySqlException
MsgBox("sorry connection failed")
End Try
command.Connection = conn
command.CommandText = Sql
adapter.SelectCommand = command
Dim mydata As MySqlDataReader
mydata = command.ExecuteReader()
If mydata.HasRows = 0 Then
MsgBox("Invalid username/password", MsgBoxStyle.Information)
Else
Form1.Show()
Me.Close()
End If.
If i add a third parameter named level to the sql statement, how do i determine which form shows???