0

hi guys, newbie here, I want to make a login page based on VB.NET language and I have a problem

basically, I have a SQL database table named XYZ and the columns are id, username, password, and type

type is to determine wether the user logging in is a user or an admin

so, how to verify that? let's say if I log in as user I will be forwared to user page and if I log in as admin I will be forwarded to admin page...

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by phoenix911
0

thank you for the reply, but what I meant is how to access the table and select the right username and then verify the type... sorry if my first post isn't clear enough...

Edited by Frii: n/a

0

u will first have to connect to your database... usually I create a class called DataAccess which only consits of the code needed to connect to the database...

links
http://msdn.microsoft.com/en-us/library/ms178371.aspx
http://www.w3schools.com/aspnet/aspnet_dbconnection.asp

..the user enters his username and password...

u can either pass both values to the query... if the query return a result > 0 then it means the username and pass is correct... which then u can check what type it is.

if the query returns 0.. then u know theres an error(username or pass incorrect)

above is the faster way round...and the better way imo

the easier way is to 1st get all the users from the db and then compare them to the username and password...

this however takes longer and will kill the connection if there are thousands of users...

Edited by phoenix911: n/a

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.