I\'m getting error: Connection must be valid and open when I start this program. I searched on google and only found 2 people that have the same error. Is it possible to fix
You need to tell your command about your connection object. Add the connection parameter to this line:
MySql.Data.MySqlClient.MySqlCommand myCommand = new MySql.Data.MySqlClient.MySqlCommand(insertQuery, connection);
Your command has no connection assignet to it. Try passing the connection to the the command's constructor like this:
MySql.Data.MySqlClient.MySqlCommand myCommand = new MySql.Data.MySqlClient.MySqlCommand(insertQuery, connection);