I\'m working on C# and MySql request. I\'m trying to retrieve my datas in my db but I have this error message : Invalid attempt to Read when reader is closed.
Thanks for
The using block closes the connection here (on exit)
using (mysqlCommand = new MySqlCommand(query, mysqlConnection))
If I'm not mistaken, it's the using statement that is killing the reader. Once the using block is terminated, IDisposable will fire on your MySQLConnection, closing and disposing your connection to the database.
Your reader is getting closed because it's wrapped in that using statement. When the command and connection are disposed, so is the reader. You'll need to get the data out before disposing the reader.