hi folks

I am currently working on developing a program in VB using Visual studio 2005 and i have come accros some error's with my program that i just cant seem to solve.

1) One of the aspects is a log inform that i have implimented. Now i am currently using an IF statment to say if the value inputted by the user is equal to a pre defined string i have entered for the username and password then allow the user to navigate to the next page, otherwise give them an error message...... This works fine, but what i really want to do is is compare it to a table that i have made in a database, if the username and password is contained in this table i want it to accept that. As at present i only have one login that cannot be changed outside of the code.

the idea is to create a table as follows

username | Password

if username and pasword is in this table, the allow them to progress

2) the second issue that i have come across is one of my form that is databinded to a table called "Till" what i want to do here is create a drop down menu where the usere can select an employee id of who the till is assigned to, i have set it up as a forgien key already but that drop down menu doesent seem to work.

any idea's here wuld be greatly apreciated, as i have exhausted all other resources

Thanks in advanced

Re: Visual Basic General VB Issue's Login Form, Forgien Key

Bruno Yu - MSFT


1. For your first question, I recommend you to try a sample code provided in VB-Helper of the Login Form in the following link:

You can start from a Main subroutine. This routine displays a login form. That form returns DialogResult.OK or DialogResult.Cancel depending on whether the user name and password are valid. If the form returns DialogResult.OK, Sub Main displays the program's main form. Note that it displays the form as a dialog so Sub Main doesn't continue executing until that form is closed. If it displayed the form non-modally, Sub Main would continue running, reach the End Sub statement, and the whole program would exit.

2. For your second question, I would like to provide you an article with the sample project, too. Please follow the article and try the sample application:

Verify a username and password in a database in Visual Basic .NET

This example shows how to verify a username and password in a database in Visual Basic .NET.