Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to display the username in the header when logged in. After logged in, The user name and its id can display all other form's in a project.
My front end is vb.net and back end is ms access.
Posted

Windows or web application? I think its windows application.

After login save the User id & User name in static variable or something. And display the value anywhere. If its a web application then store the details in Session & display the values.
 
Share this answer
 
Comments
ckulasekaran 16-Dec-11 5:03am    
Its windows application
koolprasad2003 16-Dec-11 5:04am    
Exactly. static variable will help.5.
Yes. as Raja said. use static variable and assign login userid to variable then you can access them everywhere in project.
static variable act's like a global variable. you can use public module with variable used as Global.

Create global variable in VB.NET windows application[^]

and Take label on each form to assign this variable.
 
Share this answer
 
Comments
thatraja 16-Dec-11 6:17am    
5!
It is very simple

here is the sample

VB
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Label1.Text = Form1.TextBox1.Text
   End Sub
 
Share this answer
 
Comments
Balakrishnan Dhinakaran 16-Dec-11 5:00am    
This is basic you can get idea from this
ckulasekaran 16-Dec-11 5:13am    
Thank U....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900