Sun. Dec 8th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

ASP.NET Tutorial 6- Create a Login website – Login page & Validating User and Password in database

3 min read login validation with database
c# – Validating username and password in a database in
Validating User Input in ASP.NET Web Pages Sites
Asp.Net Examples: Simple login form example in
How to create Login page/form and check username,password in database
Simple login form example in Check Username
How to implement form validation using ASP.Net 2.0
How to Validate User Login in using DataSet
ASP.NET Form to Database with Form Validation
ASP.NET Database Login
ASP.NET FormDecorator Demo – Validation and Login Controls

★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ ⚫️
Java Programming Course ➡️ ⚫️
Bash Shell Scripting Course ➡️ ⚫️
Linux Command Line Tutorials ➡️ ⚫️
C Programming Course ➡️ ⚫️
C++ Programming Course ➡️ ⚫️
PHP Programming Course ➡️ ⚫️
Android Development Course ➡️ ⚫️
C# Programming Course ➡️ ⚫️
JavaFx Programming Course ➡️ ⚫️
NodeJs Programming Course ➡️ ⚫️
Jenkins Course For Developers and DevOps ➡️ ⚫️
Scala Programming Tutorial Course ➡️ ⚫️
Bootstrap Responsive Web Design Tutorial ➡️ ⚫️
MongoDB Tutorial Course ➡️ ⚫️
QT C++ GUI Tutorial For Beginners ➡️

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare –
Data Science – |
Machine Learning – |
Artificial Intelligence – |
MERN Stack E-Degree Program – |
DevOps E-degree – |
Data Analytics with R – |
AWS Certification Training – |
Projects in Java – |
Machine Learning With TensorFlow – |
Angular 8 – Complete Essential Guide –
Kotlin Android Development Masterclass –
Learn iOS Programming Building Advance Projects –

★★★ Follow ★★★
My Website –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

42 thoughts on “ASP.NET Tutorial 6- Create a Login website – Login page & Validating User and Password in database

  1. Hi friend. Could you help me? I need to do a form login connecting a external API Rest. Contact me e tell me the yout price. Paymate advance. It's simple, unfortunalety I have no time to do that. Thanks

  2. Sir how to create admin and user page redirection both are different means user redirect to userhome page and admin redirect to adminhome page please help me…

  3. Can somebody help me please… i respected the code from this video but this error keep appear:
    An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code

  4. When you use the replace(" ","") function, wouldn't the trim function be easier. What would be even easier than that is to do a lookup of username and password at the same time. If you can't find that combination, fail the login. I know this hides whether the username exists, but in a real world application, that's what you want.

  5. where is the probleme??

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.SqlClient;
    using System.Configuration;

    public partial class login : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void Login_ID_Click(object sender, EventArgs e)
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
    string checkuser = "select count(*) from UserData where Username=' " + TextBox1Username.Text + " ' ";
    SqlCommand com = new SqlCommand(checkuser, conn);
    int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
    if (temp == 1)
    string checkPasswordQuery = "select password from UserData where Username=' " + TextBox1Username.Text + " ' ";
    SqlCommand passComm = new SqlCommand(checkPasswordQuery, conn);
    string password = passComm.ExecuteScalar().ToString().Replace(" ", "");
    if (password == TextBox2Password.Text)
    Session["New"] = TextBox1Username.Text;
    Response.Write("Password is Correct");
    Response.Write("Passwors is not Correct ");

    Response.Write("Username is not Correct");

  6. getting this problem registration.mdf not opening plz help

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

  7. Hello ProgrammingKnowledge:

    I watched all 9 videos in this tutorial series, and I must say they are great and especially helpful to beginners.

    However, I do have something to say about this 6th video:

    First of all, one reason why you had to use Replace(" ", "") to remove all extra spaces retrieved from the database record is, yes, as someone had already mentioned, because there are indeed extra spaces added to all your password entries. And the reason is you selected the nchar data type for your table columns, instead of varchar.

    One of the differences between nchar and varchar is that nchar adds extra spaces (other similar types like binary adds extra zeros) to fill up the remaining empty spots in order to reach the maximum length you specified, while varchar or other types that begin with "var," such as varbinary, do not add extra spaces or characters.

    So, I strongly encourage you update or add a script in your original video, recommending viewers to change the data type of any columns that they don't want extra spaces or characters added automatically to varchar (variable size) or char (fixed length).

    Furthermore, I think you should at least briefly mention that directly storing passwords in database without any form of hashing is so insecure. It is just for quick demonstration purposes only. Thank you for reading!

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.