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,
Abey.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.