Ervan uitgaande dat uw verbindingsreeks juist is. Probeer dit
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();
U kunt deze link ter referentie raadplegen.Uitzondering:System.InvalidOperationException Aanmeldingsgegevens proberen te valideren
Ik hoop dat dit helpt :)