how i can retrive the username from database based on the username and password only to make a welcome at the first page?
new SE 0 Junior Poster in Training
Recommended Answers
Jump to PostJust Create a session put the user name in it access in your master page and use it where ever you want to use that's all.
egSession["FirstName"] = FirstNameTextBox.Text;
to access
String str=Session["FirstName"].ToString();
that's all you need to do.
Jump to Postsimply retreive the contactname from database with that query.
SqlCommand com = new SqlCommand(cmdString, con); string contact=Convert.ToString(com.ExecuteScalar());
Jump to Postlabelwelcome.Text = "Hello " + contact + " !";
All 11 Replies
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
new SE 0 Junior Poster in Training
new SE 0 Junior Poster in Training
ans2007kumar 0 Light Poster
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
new SE 0 Junior Poster in Training
new SE 0 Junior Poster in Training
new SE 0 Junior Poster in Training
mono_jit23 1 Junior Poster in Training
mono_jit23 1 Junior Poster in Training
new SE 0 Junior Poster in Training
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.