Hi, I have designed a front end screen for a simple login page with two fields username and password in ASP.net/VB.net. I want the data that I enter into the textboxes to be populated into the database, on click of submit button and a confirmation message like 'Your data has been entered successfully'.
Please explain me two things.
1.How can I connect to the database and how should the insert statement be?
2.How can I redirect my login screen to the success page?
It would be helpful if someone could explain it in a step - by step manner as if to a beginner.

Thanks in Advance,

6 Years
Discussion Span
Last Post by b89smith

You need to get a connector for your SQL server. If you are trying to authenticate over the network, inserting will record the data into the database this is not what you want for authentication. Instead you want to pass the following query to your database. Also you want to hash the users password for added security.

SELECT `username`, `password` FROM `user_table` WHERE `username` = 'The persons username' AND `password` = 'The persons hashed password'

If this query returns one row you know that the person provided valid credentials. If you wanted to record their login you could pass an update command to change the last login date where username equals their username.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.