How to know the user login - vb.net

Using VB.Net and SQL Server 2005
I have a login page in Windows based application, Once login, in the next page the user name should display in the menu.
For Example,
In a Admin Login, the Admin should display in the MDI From menu
In a User Login, the User name should display in the MDI From menu
...
Need VB.Net Code Help

I presume that you have a table named Login and has three fields (username,password,role).
Pseudo code:
Fetch the role from the login table of given username and password.
If result is null then say "good bye" and exit from the system.
If result is "Admin" then instantiate/show the Admin MDI.
If result is "User" then open/show User MDI form.

Do you mean the name of the logged-in user?
User.Identity.Name

Related

when accessing the login again, the user has the same option selected (kotlin)

I have an app that I would like that when performing the login and the user selects a radio button in the option he wants, this information is already selected when he accesses the account again with the same login, only if it is the same login, if it is another perform the normal process of selecting an option.

Show admin button for the user with role 'admin'

I created a role 'admin' using RBAC and now I need to show admin button in the main menu if logged in user has such a role. How can I realize that?

`Settings` tab is missing in OpenERP-7

In OpenERP application Settings tab is missing, how do I get back this tab and I am using OpenERP-7.
You need to checkout access right of the User. Login with Admin User or any other User who can see the all list of Users. And open that User which don't see the Setting tab.
On User form view has Access Rights page. It has Application => Administration selection field. That might be empty.
So select Access Rights or Settings to Application => Administration
Save record and now login out with Admin and login with that updated User. You will see their Setting tab.

How to open a different form depending on which user is currently logged in

I have two forms Tutor Registration form and Student Registration form?
I would like to know how in vb.net i can save the values in the same table and hereafter differentiate them based on their roles?
See Environment.UserName to get which user is currently logged in.
my sugestion is turn your startup form into a splash screen with a timer , check the username and open the form you want wen the timer ticks

sub menu based on logged in role

I'm trying to learn ASP.NET MVC and have created new project. My first thought was how am I going to provide users means of accessing system areas and functionality.
I am, initially, looking at 2 user roles of User and Administrator. I searched and found the post below on displaying menus based on roles and this is great but I need a method of displaying differing sub menu's for a user and an administrator, for instance an administrator might be able to amend a customers credit limit etc.. but user not. Ideally I would show a sub menu beneath customer menu for CreditLimit that user would not be shown but admin would?
http://techbrij.com/role-based-menu-asp-net-mvc
Is this possible or should I simply create a "Customer" area and show/not show buttons/links on this page based on logged in role?
Thanks for any advice.