944,093 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1730
  • VB.NET RSS
Nov 22nd, 2007
0

login

Expand Post »
when a user logs in i want assign a particular form to him depending on the user name he entered. that means different forms for different users.im using oledbdataadapter to connect to sql. i will appreciate your help.thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sisey is offline Offline
2 posts
since Nov 2007
Nov 23rd, 2007
1

Re: login

you mean that when user finished login, user access
a form in accordance with the rules?
Reputation Points: 1182
Solved Threads: 393
Posting Sensei
Jx_Man is offline Offline
3,145 posts
since Nov 2007
Nov 29th, 2007
0

Re: login

Click to Expand / Collapse  Quote originally posted by Jx_Man ...
you mean that when user finished login, user access
a form in accordance with the rules?
yes
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sisey is offline Offline
2 posts
since Nov 2007
Nov 29th, 2007
3

Re: login

you must to have a main menu. u can add code in form login to disable sub menu agree with user role.
so when user finished login, user only chosen the sub menu or menu that user depending on.
ex :
Dim Menu As New Main_Menu
Menu.Show()
Menu.x.Enabled = False

x : menu or sub menu in main menu that u want to disable.

this my part project n have same like u. but i didn't use oledbdataadapter, just for comparison.
VB.NET Syntax (Toggle Plain Text)
  1. If cmbRole.SelectedIndex = 0 Then
  2. If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id
  3. If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password
  4. If dtUser.Rows(0).Item("ID_ROLE") = 1 Then ' cheking role
  5. Dim menu As New Menu_Utama
  6. Menu.Show()
  7. Me.Dispose(False)
  8. Else
  9. MsgBox("You not Admin")
  10. End If
  11. Else
  12. MsgBox("Wrong password!!", MsgBoxStyle.Critical, "Password Error")
  13. End If
  14. Else
  15. MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id")
  16. End If
  17. Else
  18. If cmbRole.SelectedIndex = 1 Then
  19. If dtUser1.Rows(0).Item(0) = Trim(txtUserId.Text) Then 'checking user id
  20. If dtUser2.Rows(0).Item(0) = Trim(txtPasw.Text) Then ' cheking password
  21. If dtUser.Rows(0).Item("ID_ROLE") = 2 Then ' cheking role
  22. Dim menu As New Menu_Utama
  23. Menu.Show()
  24. Menu.mnUser.Enabled = False
  25. Menu.BarMenu.Buttons(6).Enabled = False
  26. Me.Dispose(False)
  27. Else
  28. MsgBox("You not Headmaster")
  29. End If
  30. Else
  31. MsgBox("Wrong Password!!", MsgBoxStyle.Critical, "Password Error")
  32. End If
  33. Else
  34. MsgBox("Your User Id is not valid", MsgBoxStyle.Critical, "Wrong User_Id")
  35. End If
  36. End If
  37. End If
in my project, i have 2 user (Admin & Headmaster)
admin can utilize all menu or sub menu in Main Menu.
Headmaster have same like Admin but headmaster can't to use User Management (add or delete user).

ok.that is. hope this help.
Last edited by cscgal; Nov 29th, 2007 at 11:40 pm. Reason: Added code tags
Reputation Points: 1182
Solved Threads: 393
Posting Sensei
Jx_Man is offline Offline
3,145 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Need help generating a Grand Total
Next Thread in VB.NET Forum Timeline: can not update combo box...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC