User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 374,163 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,272 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

simple ASP.Net Loginpage with SQL server

Join Date: May 2008
Posts: 4
Reputation: vmadhu_ece is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
vmadhu_ece vmadhu_ece is offline Offline
Newbie Poster

Re: simple ASP.Net Loginpage with SQL server

  #4  
May 9th, 2008
u hould create table eiyh two columns and enter username and password in table using insert command.
then come to asp page
in page load 1. initialize the connection using the code sqlconnection con=new sqlconnection(); 2.open the connection con.open() 3. sqlcommand cmd=new sqlcommand("select *from tablename",con); 4. sqldatareader dr=cmd.executereader() 5. while(dr.read()) 6.
  1. if ((TxtUsername.Text) ==re.GetString(0) && (TxtPassword.Text) == re.GetString(1))
  2. {
  3. Response.Redirect("default.aspx");
  4. }
  5. else
  6. {
  7. Response.write("invalid");
  8. }
Last edited by peter_budo : May 11th, 2008 at 5:24 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
All times are GMT -4. The time now is 3:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC