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 391,558 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 2,736 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
Views: 614 | Replies: 7
Reply
Join Date: Aug 2007
Posts: 4
Reputation: gminghon is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gminghon gminghon is offline Offline
Newbie Poster

Help help me pls.. tml 10 more hours to due date..!!

  #1  
Aug 20th, 2007
can anyone show me to login page code?? i did my registration code already.. now i need the login page the userid and pword read from my database access then the user can log in to another page.. i need the whole code. as simple as possible.. thankyou very much. this is my asp.net assignment.. im very weak in asp.net.. pls help.. tq.. im doing dvd rental assignment..

im using asp.net 1.1 and microsoft access 2003
Last edited by gminghon : Aug 20th, 2007 at 11:58 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 14
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: help me pls.. tml 10 more hours to due date..!!

  #2  
Aug 20th, 2007
Use this code
<script runat="server">
void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>

You can fill the Dataset "ds_user" with this valid user check result. This will have 1 record if the username and password matches
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 14
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: help me pls.. tml 10 more hours to due date..!!

  #3  
Aug 20th, 2007
Query to validate the user name and password is:

SELECT user_id, user_name, user_pwd
FROM tbl_users
WHERE user_name = @user_name AND user_pwd = @userpwd

You can also use the windows authentication by using (AuthenticatioMode = Windows) in app.config file
Reply With Quote  
Join Date: Aug 2007
Posts: 4
Reputation: gminghon is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gminghon gminghon is offline Offline
Newbie Poster

Re: help me pls.. tml 10 more hours to due date..!!

  #4  
Aug 20th, 2007
omg... i dun understand.. but wat i wan is the userid and pword textbox is read from my microsoft access database..let say my database name user_details.mdb
if userid and pword match wif access database redirect to home.aspx if not match error.. wait should i do?? i really dunno how to code this login page... can teach me step by step? or create the login page for me??
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 14
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: help me pls.. tml 10 more hours to due date..!!

  #5  
Aug 20th, 2007
It does not matter what Database your are using. Even if you are using the logic will remain the same. But the only thing that would change is the Database connection string. You can use OLE_DB to connect to the Access Database and then do the rest of the task.

Connection string would be something like this for Access:
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"
Reply With Quote  
Join Date: Aug 2007
Posts: 4
Reputation: gminghon is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gminghon gminghon is offline Offline
Newbie Poster

Re: help me pls.. tml 10 more hours to due date..!!

  #6  
Aug 20th, 2007
so the code should be

urm the top should
import.xxxx
<script runat="server">
Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath "user_details.mdb") & ";"

void button_click(Object s, EventArgs e)
{
if (ds_user.RecordCount == 1)
{
Response.Cookies["ckuser"].Value = txtusername.Text;
Response.Cookies["ckuser"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("home.aspx");
}
}
</script>

like this???
Reply With Quote  
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation: binoj_daniel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 14
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: help me pls.. tml 10 more hours to due date..!!

  #7  
Aug 20th, 2007
yes and then you need to open the Dataset also when the users clicks on submit. ie; "ds_user"
For web applications it is recommended to use Data Readers instead of Data Sets.
Reply With Quote  
Join Date: Aug 2007
Posts: 4
Reputation: gminghon is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gminghon gminghon is offline Offline
Newbie Poster

Re: help me pls.. tml 10 more hours to due date..!!

  #8  
Aug 20th, 2007
binoj_daniel do u have msn?? or email?? can u help me create my login page.. i wil send u my project to u.. or i can ask you question thru msn.. coz my pc is slow.. can't open too many application...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:53 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC