Code:
public static void DeleteGuild(int ID)
{
if (Nano.Guilds.ContainsKey(ID))
{
Struct.GuildInfo GuToDel = Nano.Guilds[ID];
foreach (int ChId in GuToDel.GMems)
{
try
{
MySqlCommand Cmd2 = new MySqlCommand("UPDATE `characters` SET `Guild` = " + 0 + ", `GRank` = " + 0 + ", `GDonation` = " + 0 + " WHERE `CharID` = " + ChId, DatabaseConnection.Connection);
Cmd2.ExecuteNonQuery();
Cmd2.Connection.Close();
Cmd2.Connection.Dispose();
Cmd2.Dispose();
}
catch
{
//Console.WriteLine("Character not exist anymore");
}
}
Nano.Guilds.Remove(ID);
}
MySqlCommand Cmd = new MySqlCommand("DELETE FROM `guilds` Where `GuildID` = " + ID + "", DatabaseConnection.Connection);
Cmd.ExecuteNonQuery();// <--- comes up says data reader allready associated blh blh bullshit!
Cmd.Connection.Close();
Cmd.Connection.Dispose();
Cmd.Dispose();
}
MySql Exception was Unhandled.
There is already an open DataReader associated with this Connection which must be closed first.
Any ideas?






