Hello I'm having a bit of a problem with my code.. I get this error and it depends on
myReader = SelectCommand.ExecuteReader();
I really don't understand it.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''password' at line 1
MySqlConnection conn = new MySqlConnection("secretstring")
MySqlCommand SelectCommand = new MySqlCommand("SELECT * FROM userspassword where'" + this.loginuser.Text + "'and password'" + this.passworduser.Text, conn);
MySqlDataReader myReader;
conn.Open();
//myReader = SelectCommand.ExecuteReader();
myReader = SelectCommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 1)
{
MessageBox.Show("Correct");
Form2 pannel = new Form2();
pannel.Show();
Hide();
}
else if (count > 1)
{
MessageBox.Show("More then 1 user logged in");
}
else
MessageBox.Show("Incorrect password or username");
conn.Close();