MySqlCommand command = connection.CreateCommand();
command.CommandText = string.Format("SELECT * FROM characters WHERE account_id = '{0}'", this.ID);
MySqlDataReader reader = command.ExecuteReader();
while (reader.Read()) { ... }
I get an error at the last line saying "Invalid attempt to Read when reader is closed." Now, if I add another line before it, as in:
MySqlCommand command = connection.CreateCommand();
command.CommandText = string.Format("SELECT * FROM characters WHERE account_id = '{0}'", this.ID);
MySqlDataReader reader = command.ExecuteReader();
reader = command.ExecuteReader(); // Here.
while (reader.Read()) { ... }
I get an error at that new line saying "There is already an open DataReader associated with this Connection which must be closed first."
Alright, I don't want to get picky here, but is my reader open or closed?