Hello. I have a login form code that checks for username and password:
Code:
int i;
for (i = 0; i < database1DataSet.users.Count; i++)
{
if (database1DataSet.users.Rows[i][1].Equals(txtUser.Text))
{
if (database1DataSet.users.Rows[i][2].Equals (txtPassword.Text))
{ MessageBox.Show("Access granted"); }
}
I know that this is a stupid way to execute a user and password check (the for i), but I searched google for hours, and did not find any better solution for my project.
Please help me simplifying this code