Hmm. You are confusing yourself. I do the same type of thing every day in all of my applications (the only difference is that their logon is completely transparent to the user) and its not that hard, you are just making it as such!! ;]
Essentially what you are doing is setting up a Role based permission set, user's don't actually have rights to the application, the Role that they belong to has permissions. My table structure is something like this: (I have added a password column to help you with your example)
UserTable
UserID Password Role_FK
---------------------------
4218 foo 1
4219 superfoo 2
RoleTable
ID Description
-----------------------
1 Admin
2 Member
3 Guest
Now you could do something like this:
Dim s as String = String.Format("SELECT Role_fk From UserTable where UserName={0} and PassWord={1}", Me.txtUserName.text, Me.txtPassword.text)
//Fill a DataTable/DataSet/DataReader
I will use a DataTable as my example:
If dt.Rows.Count = 0 Then
MessageBox.Show("You provided an Invalid UserName and password!")
Else
Dim iRole as Integer = Convert.ToInt32(dt.Rows(0).Item("Role_FK"))
SELECT CASE iRole
Case 1
'You are an Admin show all controls
Case 2
'You are a User show some controls
Case 3
'You are a guest show no controls
END Select
End If
I think that is very straight forward but let me know if you have any questions.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========