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 426,930 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,438 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: 151690 | Replies: 74 | Solved
Closed Thread
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 VB.Net)

  #61  
May 3rd, 2005
Ok, I will do my best.

I need more details as to what the problem is. Provide code where you can, and I need you to answer a few questions:

1. Did you just copy and paste my code?
2. Are you using an Access or an SQL Database?
3. To clarify what you have said, you get a successful login with correct or incorrect data??
4. Are you using Visual Studio, ASP.Net Web Matrix, or something else? Why I am asking this, is to see if you have put breakpoints in your code to follow what data is being passed around.

The if you answer NO to the first question, please provide the code (or personal message me) so I can go through it for you.


Originally Posted by lorf14plus
Excuse me I am a novice in asp.net and i prove to create a new alogin application wirh this code, but my page don't make any check on the table when I make the submit return all the time at the login page. i prove to enter correct data and wrong data can yiou help me please???
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
 
Join Date: May 2005
Posts: 20
Reputation: lorf14plus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
lorf14plus lorf14plus is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #62  
May 4th, 2005
In advance thanks for your help.
1. I have copy all your code code that you have posted and I download the txt file that you have putted in the thread.
2. I have used for commodity the database ACCESS. (I make the prove with my database and with your database)
3. I don't now if the login goes well or not remain in all the case in the login page, probably return always a incorect login.
4. I using Visual Studio.Net.

To help you to help me I put the sorces code that I have entered in my page.

Thanks a lot for your help.
Attached Files
File Type: zip ASP.NET.zip (42.6 KB, 52 views)
 
Join Date: May 2005
Posts: 20
Reputation: lorf14plus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
lorf14plus lorf14plus is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #63  
May 4th, 2005
I have made other prove and I have correct the path of the database in the web.config, i put the correct path, but the objReader.Read() return always a true value.
I substitute the stored procedures with a normal query select * from usr_user but the result don't change the objReader.Read() is true, where is my error?? :cry: :cry:

Thanks for your help
 
Join Date: Apr 2005
Location: Tennessee
Posts: 18
Reputation: millers_35 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
millers_35 millers_35 is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #64  
May 5th, 2005
I dont really know how your wanting to go about this login but it doesnt look like its the same as Paladines. In his example he is making sure that "1" user in the database has a username password that match what was put into the textboxes. Example
SELECT COUNT(*) AS Num_of_User
FROM tblUser
WHERE (((tblUser.U_Name)=[@UserName]) AND ((tblUser.U_Password)=[@Password]));
Notice "COUNT" if the query finds a username and password that match in the database it gonna return a value of "1"
While objReader.Read()
                If CStr(objReader.GetValue(0)) <> "1" Then
                    lblMessage.Text = "Invalid Login!"
                Else
                    objReader.Close()   '   |||||   Close the Connections & Reader
                    Return True
                End If

Notice the .GetValue(0)) <> "1". Meaning if the value is not = "1" then "Invalid Login" During Paladines query if it doesnt find the matching username and password it will return a value of "0" therefore will not allow the login to take place.

So that being said if you want to do it the way he is you must change your Stored Procedure to:

SELECT COUNT(*) AS Num_of_User
FROM USR_USER
WHERE (((USR_USER.USR_USERID)=[@UserName]) AND ((USR_USER.USR_PASSWORD)=[@Password]));

I have went ahead and fixed it for you in your database so try it and tell me what you come up with.

Miller
Attached Files
File Type: zip gestione_pers.zip (37.3 KB, 37 views)
 
Join Date: May 2005
Posts: 20
Reputation: lorf14plus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
lorf14plus lorf14plus is offline Offline
Newbie Poster

Solution Re: Simple ASP.Net Login Page (Using VB.Net)

  #65  
May 6th, 2005
Thanks a lot Miller it's really a stupid error, I make an error to the generation of the query.
It's obvous that the login page return always a different value for this field.
Thanks for your help and good work.

:lol: :lol:
 
Join Date: Apr 2005
Location: Tennessee
Posts: 18
Reputation: millers_35 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
millers_35 millers_35 is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #66  
May 8th, 2005
np man just trying to give back to da community. This site has helped me out alot.

Miller
 
Join Date: May 2005
Posts: 2
Reputation: phuture is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
phuture phuture is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #67  
May 10th, 2005
Can somebody help me please? It Just Doesn't accept the Catch ex As Exception statement. What should i do ?
Thanks in advance







Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'Exception' is not defined.

Source Error:



Line 101: End While
Line 102:
Line 103: Catch ex As Exception
Line 104: outputLabel.Text = "Error Connecting to Database!"
Line 105: Finally


Source File: C:\Trial\login.aspx.vb Line: 103
 
Join Date: May 2005
Posts: 20
Reputation: lorf14plus is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
lorf14plus lorf14plus is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #68  
May 11th, 2005
Hi post the portion of code of the try-catch-finaly and if I found an error i post you the correct code.

Bye
 
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 VB.Net)

  #69  
May 11th, 2005
just for curiosity, but you do have the try part of the try-catch block above this code??

Have you rebuilt the project?


Originally Posted by phuture
Can somebody help me please? It Just Doesn't accept the Catch ex As Exception statement. What should i do ?
Thanks in advance







Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'Exception' is not defined.

Source Error:



Line 101: End While
Line 102:
Line 103: Catch ex As Exception
Line 104: outputLabel.Text = "Error Connecting to Database!"
Line 105: Finally


Source File: C:\Trial\login.aspx.vb Line: 103
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
 
Join Date: May 2005
Posts: 2
Reputation: phuture is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
phuture phuture is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #70  
May 12th, 2005
Thanks guys but i manage to find the problem. I imported oleDb exception and just change exception to oleDbexception and everything is fine now.
 
Closed Thread

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

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

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