Hi guys,
I am developing a music library application in visual studio using C#. I have crated a login form which will be showing the "user form" after successful login. In the login form i am using "Id" and "Password" . In sql server database there is name related to each Ids.
I want to show on "User" form something like "Welcome : User Name"
My question is how can I show the name on User form after logging in with ID from LogIn form . Any process to retrieve the name from sql server and show it in User form??
Please help.
Thank you..

Akhil GargRank #772 · 3K reputationPosted Apr 5, 2015, 12:58 AM EDT
https://msdn.microsoft.com/en-us/library/03sekbw5%28v=vs.140%29.aspx
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 5, 2015, 1:06 AM EDT
You can use session variables...
Eg -
say on Login button click event -
if - login is successful
session["username"] = txt_Username.text.trim();
---
Then...
string s = "Welcome"+"\t"+ session["username"].ToString().Trim();
----------
Joy Banerjee49 reputationPosted Apr 5, 2015, 1:18 AM EDT
Please see the screen shots.
I want to show the user name on USER form after successful login using ID.
Akhil GargRank #772 · 3K reputationPosted Apr 5, 2015, 1:22 AM EDT
Joy Banerjee49 reputationPosted Apr 5, 2015, 1:40 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Apr 5, 2015, 1:42 AM EDT
In your login click read the particular id details in database then save the username of given id to Session variable,like this..
obj.readvalue(str);//read your table using given password and userid
//save the particular id username into session
Session["Username"] = obj.username;
Rajeesh MenothRank #118 · 18.4K reputationPosted Apr 5, 2015, 1:57 AM EDT
Check this link : http://www.c-sharpcorner.com/UploadFile/satyapriyanayak/display-details-of-user-after-successfull-login/
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:31 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:31 AM EDT