Forudsat at din forbindelsesstreng er rigtig .. Prøv dette
connectionString = @"server=localhost;database=" + lbDatabase.SelectedItem.ToString() + ";userid=root;password=;";
string query = "SELECT order_id FROM orders WHERE id = 1";
MySqlConnection connect = new MySqlConnection(connectionString);
MySqlCommand cmd = new MySqlCommand(query, connect);
connect.Open();
reader = cmd.ExecuteReader();
/*Do Whatever You Want To Do Here */
connect.Close();
Du kan henvise til dette link.Undtagelse:System.InvalidOperationException Forsøger at validere en login-information
Håber dette hjælper :)