hi sir,
i am manikyaprabhu
i create the two web from ( registerfrom and login from )
i want coding for the login form using register form
i
hi sir,
i am manikyaprabhu
i create the two web from ( registerfrom and login from )
i want coding for the login form using register form
i
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Raj KumarPosted Aug 12, 2008, 12:58 AM
See this article, I am sure will help.
http://www.c-sharpcorner.com/UploadFile/raj1979/LoginControl07242008104351AM/LoginControl.aspx?ArticleID=e06b9d4f-b65c-4c63-babc-fb65ef3224f7
Niradhip ChakrabortyPosted Aug 11, 2008, 9:17 PM
Try the following code:
using system.data.sqlclient;
using system.web.configuration;
Sqlconnection con = new sqlconnection("your conectionstring");
or
Sqlconnection con = new Sqlconnection(WebconfigurationManager.connectionstrings["your connetion name"].connectionstring);
Sqlcommand cmd = new sqlcommand();
cmd.commandtext = "select * from table";
cmd.connection = con;
if (con.state==connectionstate.closed) con.open();
SqlDatareader dr = cmd.executereader();
while(dr.read)
{
if ( dr["Username"] == textbox1.text.trim() && dr["Password"] == textbox2.text )
{
response.redirect("Homepage.aspx");
return;
}
}
Please go through with following URL for your reference.
1.http://www.daniweb.com/forums/thread6028.html
2.http://www.daniweb.com/forums/thread6028.html