Hello, I have setup my database with an employee table using an ID row, and Pass row. I currently have a login page where Im using a standard IF statement where ID = something and Pass = something, then show next form.
How do I set it up so that when the textbox's are filled in and the login button is clicked it will check the database and compare the row, and allow access Im sure it easy, but I havent found any tutorials on it.
Thanks

Login form using database
JordanTan
Well, first of all you should create a command containing an SQL statement to retrieve the Pass field corresponding to a certain ID. For security reason I would suggest to implement the ID part of the statement using Parameters and not using normal string concat.
After this, you sould grab the ID from the proper Textbox, use the text as value for the ID parameter and launch the command. The SQL will return a string that is the Pass corresponding to the user you searched for, or an error if the ID does not exist. Now you must simply compare the string contained in the Pass textbox with the one in returned by the statement. If they matches, then the user is allowed, if not, he is rejected.
As a final note, personally I would think about storing in the DB and thus comparing not the actual (plain text-) password, but an hash of it.
Ciao
Luca
Jason Hogg
Thanks for the response, however...
Could you possibly include a simple code that will go with the login button click event. Lets say my Database is SQL express named Sample, the table is called Employee, and the 2 columns are UserID, and Pass. From that info could you include some code to help me out. Im not concerned that much right now with the whole hashing thing, thats another day! Once again, Im using VB.net Express, and SQL express.
Thanks again.