| | |
Asp.Net Login Page Problem?
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2006
Posts: 17
Reputation:
Solved Threads: 0
VB.NET Code behind:
i m getting : output as:
Username and Password Not Found.Please Try Again!"
instead i have that username in the database. Also i m inputting correct Username and Password.
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dbconn As SqlConnection Dim dbcommand As SqlDataAdapter Dim dslogin As New DataSet dbconn = New SqlConnection("Server=localhost;UID=sa;PWD=sa;database=websiteDemo") dbconn.Open() dbcommand = New SqlDataAdapter("Select UserID from " _ & "Login Where " _ & "Username = '" & TextBox1.Text _ & "' and Password = '" & TextBox2.Text _ & "'", dbconn) dbcommand.Fill(dslogin, "Login") If dslogin.Tables("Login").Rows.Count = 0 Then Response.Write(dslogin.Tables("Login").Rows.Count = 0) Label3.Text = "Username and Password Not Found.Please Try Again!" Else Session("UserID") = dslogin.Tables("Login").Rows(0).Item("UserID") Session("Username") = TextBox1.Text Response.Redirect("./Success.aspx") End If End Sub
i m getting : output as:
Username and Password Not Found.Please Try Again!"
instead i have that username in the database. Also i m inputting correct Username and Password.
Last edited by tgreer; Oct 22nd, 2006 at 5:45 pm. Reason: Ignored instructions for CODE tags
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
The forum software uses code tags for posting code. They are clearly explained in the message editor when you post a message. Just follow the instructions. Also, we use full complete standard English here, instead of the substitutions such as "i"and "u".
I don't code in VB.NET sorry. In any case, ASP.NET Authentication is a well-covered topic with thousands of tutorials on the topic available on the web. Glancing over your code, I see no obvious errors. I tend not to use DataAdapters and DataTables and all that mess. I use stored procedures. You execute them, get the response into a simple DataReader, and do what you need to do.
I don't code in VB.NET sorry. In any case, ASP.NET Authentication is a well-covered topic with thousands of tutorials on the topic available on the web. Glancing over your code, I see no obvious errors. I tend not to use DataAdapters and DataTables and all that mess. I use stored procedures. You execute them, get the response into a simple DataReader, and do what you need to do.
![]() |
Similar Threads
- Simple ASP.Net Login Page using C# (C#)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- ASP.NET Registration Page (ASP.NET)
- Asp.net Login Page (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: ASP.NET 2.0 Invalid attempt to FieldCount when reader is closed
- Next Thread: Need Help:-Reports in ASP.NET1.0
Views: 2568 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 activexcontrol advice ajax application asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child class click compatible confirmationcodegeneration content contenttype countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownmenu edit feedback flash flv folder form forms google grid gridview homeedition hosting identity iframe iis index javascript jquery list maps menu mono mssql multistepregistration nameisnotdeclared object objects order problem profile ratings refer rotatepage save search security serializesmo.table session silverlight smartcard software sql suse textbox tracking typeof unauthorized update validation vb vb.net video view virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt wizard xml






