What im trying to do is create an ATM , so when the user selects their account number from the combo box that holds all the account numbers from an sql database, and then enters the correct pin it allows the user to access form2. Any suggestions on how to do this.I think i need an if statement so when enter is pressed if the pin is correct continue to the next page but if is not correct ill have a message box displaying you have 2 attempts left, i just don’t no the code needed to interact with the database to match the Account number with the correct pin. The code i have already is as follows:
private void BtnEnter_Click(object sender, EventArgs e)
{
if (true)
{
Form2 frm2;
frm2 = new Form2();
frm2.ShowDialog();
}
else
{
MessageBox.Show("You have two attempts remaining");
}
}
private void Form1_Load(object sender, EventArgs e)
{
sqlDataAdapter1.Fill(dataSet11.ATMCards);
}
your should use this query if you are using ComboBox and an textbox
Hope this works for u..if u have any doubts ask me …