User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,750 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,473 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 C# advertiser: Programming Forums
Views: 91352 | Replies: 59
Reply
Join Date: Sep 2005
Posts: 11
Reputation: awaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
awaw awaw is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #21  
Nov 24th, 2005
Paladine
can you attach the file and database it will be more helpful
Reply With Quote  
Join Date: Sep 2005
Posts: 11
Reputation: awaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
awaw awaw is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #22  
Nov 24th, 2005
HI
i used the sql database and i did your code my problem is all the input give me the message invalid passward although it is stored in the database.
Reply With Quote  
Join Date: Sep 2005
Posts: 11
Reputation: awaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
awaw awaw is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #23  
Nov 24th, 2005
the sql code work fine but give me invild message with any input eather wrong or right
Reply With Quote  
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 25
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Simple ASP.Net Login Page using C#

  #24  
Nov 25th, 2005
Are you using Visual Studio or Web Matrix?

If you are using Visual Studio, have you stepped though the code?

Comment out the Invalid Login portion of the code and see what error message you are getting from ASP.Net
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
Reply With Quote  
Join Date: Sep 2005
Posts: 11
Reputation: awaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
awaw awaw is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #25  
Nov 26th, 2005
Yes i am using Visual Studio?
but can you attach your file it may help in my stiuation
thanks
Reply With Quote  
Join Date: Sep 2005
Posts: 11
Reputation: awaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
awaw awaw is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #26  
Nov 26th, 2005
Hi
THANKS FOR Paladine for nice code
did any one try the sql code it doesn't work with me
no error but the invalid message display all the time with any input?
if any one try the sql and it work can help me ????????????

thanks again for help
Reply With Quote  
Join Date: Dec 2005
Posts: 4
Reputation: train is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
train train is offline Offline
Newbie Poster

Question Re: Simple ASP.Net Login Page using C#

  #27  
Dec 1st, 2005
Anyone that would be so kind and post the stored procedure, I'm not able to get the northwind SP, and would therefore be happy if someone could show it, as i will try to get it up and running on a MS SQL 2000 server.

I'm trying with this so far:

CREATE PROCEDURE sp_ValidateUser
@UserName varchar(16), @Password varchar(16)
AS
SELECT COUNT(*) as Num_of_Users
FROM USERS
WHERE Users.username LIKE @UserName AND Users.password LIKE @Password

it returns 1 column as Num_of_Users with a either 1 or 0 depending on valid or invalid user/password


The login form ends up just saying "Invalid Login, please try again!"


Regards
Train
Reply With Quote  
Join Date: Dec 2005
Posts: 4
Reputation: train is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
train train is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page using C#

  #28  
Dec 1st, 2005
I did manage to create the SP myself. If anyone has the same problem this was what i wrote in my SP:

CREATE PROCEDURE sp_ValidateUser
@UserName varchar(16), @Password varchar(16)
AS
DECLARE @Num_of_User INT
SELECT @Num_of_User = COUNT(*) FROM USERS WHERE (Users.username LIKE @UserName) AND (Users.[password] LIKE @Password)
RETURN @Num_of_User

GO



Table's is abit diffrent compared to the exsampel, hope you can use it anyway
Reply With Quote  
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 25
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Simple ASP.Net Login Page using C#

  #29  
Dec 2nd, 2005
The start of the tutorial states where to find the basis on which this tutorial is built.

But here is the original Stored Procedure:

CREATE PROCEDURE sp_ValidateUser /* How it would appear in QUERY ANALYZER */
(
@UserName VARCHAR(50) = NULL,
@Password VARCHAR(50) = NULL,
@Num_of_User INT = 0
)
AS
SET
@Num_of_User = (SELECT COUNT(*) AS Num_of_User
FROM NorthWindUsers
WHERE UserName = @UserName AND Password = @Password)
RETURN @Num_of_User



If you are still having troubles let me know...
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
Reply With Quote  
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 25
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Simple ASP.Net Login Page using C#

  #30  
Dec 2nd, 2005
Also one thing to note. I would avoid using LIKE as you will can have the chance of a guess working for the login, or even more likely to have multiple records.

A login should grab one, and only one record.
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
Reply With Quote  
Reply

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

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

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