Good day programmers!.
i have here a login in form1 that is connected to my sql database.
i want that if i login in form1. the form2 will show my name.
can anyone help me?.
newbie12345
0
Newbie Poster
Recommended Answers
Jump to PostYou can:
- Create a global variable that will hold your username and use it whenever you need it. In your case you'd query the db for info for that username.
- You can get all the info you want in the login sub and pass it to the second form like …
Jump to PostWhen you open form2, you only have to pass variable to constructor of form, and pas it to some control, which will show the value (ie. username):
'on form1: Public Property YourUserName() As String Get Return m_YourUserName End Get Private Set m_YourUserName = Value End Set …
Jump to PostYou can also use the Active Directory if you are wanting a full name. That would be the most accurate way if you were writing
a multiple user application. Each user's name would be in teh active directory.
All 11 Replies
adam_k
239
Master Poster
Mitja Bonca
557
Nearly a Posting Maven
darthswift00
0
Newbie Poster
Begginnerdev
256
Junior Poster
poojavb
29
Junior Poster
smitty68503
0
Light Poster
poojavb
29
Junior Poster
Begginnerdev
256
Junior Poster
smitty68503
0
Light Poster
poojavb
29
Junior Poster
smitty68503
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.