I am trying to get my data from the database and show in a messagebox but it's not working. I tried to put a dummy messagebox inside my while loop but it seems the code is not going into it also. Are there any ways to do this?
This is my code:
ConnectToDatabase();
MySqlCommand cmd = new MySqlCommand("Select Name, LPN From visitors Where password = '@password';", conn);
cmd.Parameters.AddWithValue("@password", decodeStr);
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
MessageBox.Show("he");
name = reader["Name"].ToString();
lpn = reader["LPN"].ToString();
}
cmd.Parameters.AddWithValue("@password", decodeStr);be without the@?@is validSelect Name, LPN From visitors Where password = @password;