Wed. Sep 11th, 2019

Host your Website

Read and learn

FatCow Plan for $3.15/mo. only

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

3 min read



asp.net login validation with database
c# – Validating username and password in a database in asp.net
Validating User Input in ASP.NET Web Pages Sites
Asp.Net Examples: Simple login form example in asp.net
How to create Login page/form and check username,password in database
Simple login form example in asp.net Check Username
How to implement form validation using ASP.Net 2.0
How to Validate User Login in asp.net 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 ➡️ http://bit.ly/2vsuMaS ⚫️ http://bit.ly/2GOaeQB
Java Programming Course ➡️ http://bit.ly/2GEfQMf ⚫️ http://bit.ly/2Vvjy4a
Bash Shell Scripting Course ➡️ http://bit.ly/2DBVF0C ⚫️ http://bit.ly/2UM06vF
Linux Command Line Tutorials ➡️ http://bit.ly/2IXuil0 ⚫️ http://bit.ly/2IXukt8
C Programming Course ➡️ http://bit.ly/2GQCiD1 ⚫️ http://bit.ly/2ZGN6ej
C++ Programming Course ➡️ http://bit.ly/2V4oEVJ ⚫️ http://bit.ly/2XMvqMs
PHP Programming Course ➡️ http://bit.ly/2XP71WH ⚫️ http://bit.ly/2vs3od6
Android Development Course ➡️ http://bit.ly/2UHih5H ⚫️ http://bit.ly/2IMhVci
C# Programming Course ➡️ http://bit.ly/2Vr7HEl ⚫️ http://bit.ly/2W6RXTU
JavaFx Programming Course ➡️ http://bit.ly/2XMvZWA ⚫️ http://bit.ly/2V2CoAi
NodeJs Programming Course ➡️ http://bit.ly/2GPg7gA ⚫️ http://bit.ly/2GQYTQ2
Jenkins Course For Developers and DevOps ➡️ http://bit.ly/2Wd4l4W ⚫️ http://bit.ly/2J1B1ug
Scala Programming Tutorial Course ➡️ http://bit.ly/2PysyA4 ⚫️ http://bit.ly/2PCaVj2
Bootstrap Responsive Web Design Tutorial ➡️ http://bit.ly/2DFQ2yC ⚫️ http://bit.ly/2VoJWwH
MongoDB Tutorial Course ➡️ http://bit.ly/2LaCJfP ⚫️ http://bit.ly/2WaI7Ap
QT C++ GUI Tutorial For Beginners ➡️ http://bit.ly/2vwqHSZ

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare – https://skillshare.eqcm.net/r1KEj
Data Science – http://bit.ly/2lD9h5L | http://bit.ly/2lI8wIl
Machine Learning – http://bit.ly/2WGGQpb | http://bit.ly/2GghLXX
Artificial Intelligence – http://bit.ly/2lYqaYx | http://bit.ly/2NmaPya
MERN Stack E-Degree Program – http://bit.ly/2kx2NFe | http://bit.ly/2lWj4no
DevOps E-degree – http://bit.ly/2k1PwUQ | http://bit.ly/2k8Ypfy
Data Analytics with R – http://bit.ly/2lBKqz8 | http://bit.ly/2lAjos3
AWS Certification Training – http://bit.ly/2kmLtTu | http://bit.ly/2lAkQL1
Projects in Java – http://bit.ly/2kzn25d | http://bit.ly/2lBMffs
Machine Learning With TensorFlow – http://bit.ly/2m1z3AF | http://bit.ly/2lBMhnA
Angular 8 – Complete Essential Guide – http://bit.ly/2lYvYRP
Kotlin Android Development Masterclass – http://bit.ly/2GcblsI
Learn iOS Programming Building Advance Projects – http://bit.ly/2kyX7ue

★★★ Follow ★★★
My Website – http://www.codebind.com

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);
    conn.Open();
    string checkuser = "select count(*) from UserData where Username=' " + TextBox1Username.Text + " ' ";
    SqlCommand com = new SqlCommand(checkuser, conn);
    int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
    conn.Close();
    if (temp == 1)
    {
    conn.Open();
    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.Redirect("Manager.aspx");
    }
    else
    {
    Response.Write("Passwors is not Correct ");
    }
    }

    else
    {
    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.