Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have first form as my login form here i have two text boxes one for user name ,another for password ,and a button. on button i write the code for login to next page .the problem is i want to pass the selected user name from first form to my third form .the coding is done in C# ,sql 2005 as backend.
Posted
Comments
Rajesh Anuhya 23-Oct-10 3:56am    
is your application in winforms or web???
shakil0304003 23-Oct-10 4:03am    
Rajesh: Is form available in the web? I think he told about the winforms.

you can, try this ->

Click

Click

Click
 
Share this answer
 
Sqlcommand cmd=new Sqlcommand("select * from user_master where username=@username and password=@password",con);
con.open();
cmd.parameters.addwithvalue("@username",textuser.text);
cmd.parameters.addwithvalue("@password",textpassword.text);
sqldatareader dtr=cmd.execurereader();
if(dtr.read())
{
session["username"]=dtr["username"].ToString();
Response.Redirect("Pagename");

}
else
{
login Failed
}
 
Share this answer
 
Comments
Rajesh Anuhya 23-Oct-10 3:56am    
may be she asking in winforms
Mohd Wasif 23-Oct-10 3:59am    
Ok ,
Might be as she had mentioned forms

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