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..
Gowtham RajamanickamPosted Apr 6, 2015, 4:31 AM
Gowtham RajamanickamPosted Apr 6, 2015, 4:31 AM
Rajeesh MenothPosted Apr 5, 2015, 5:57 AM
Check this link : http://www.c-sharpcorner.com/UploadFile/satyapriyanayak/display-details-of-user-after-successfull-login/
Rajeesh MenothPosted Apr 5, 2015, 5:42 AM
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;
Joy BanerjeePosted Apr 5, 2015, 5:40 AM
Akhil GargPosted Apr 5, 2015, 5:22 AM
Joy BanerjeePosted Apr 5, 2015, 5:18 AM
Please see the screen shots.
I want to show the user name on USER form after successful login using ID.
Riddhi ValechaPosted Apr 5, 2015, 5:06 AM
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();
----------
Akhil GargPosted Apr 5, 2015, 4:58 AM
https://msdn.microsoft.com/en-us/library/03sekbw5%28v=vs.140%29.aspx