MySqlCommand command1 = new MySqlCommand(sel, conn); MySqlDataReader reader1 = command1.ExecuteReader(); 

per line MySqlDataReader reader1 = command1.ExecuteReader(); Error System.InvalidOperationException: "Connection must be valid and open."

Here is a screenshot of https://prnt.sc/mdvmiy

What can this error be detected from and how can this be corrected ??

  • 2
    Because of what this error can be detected. Judging by its text, the connection is invalid and / or not opened. Check the server settings / parameters and the contents of the sel and conn variables. - Akina

0