private void CBChangedPlayer(object sender, EventArgs e) { int playerId = PlayerData.OptionsListIds[Player.SelectedIndex]; using (var conn = Database.AccessDB.Connect()) { conn.Open(); using (var reader = SQLDB.Read(conn, "SELECT Image FROM Player JOIN BaseObject WHERE BaseObject_ID = BaseObjectID AND Player_ID = " + playerId + ";")) { reader.Read(); try { PlayerImage.Image = Conversion.BytesToImage(reader, 0); } catch (Exception) { PlayerImage.Image = null; } } conn.Close(); } string where = "BaseObject_ID = BaseObjectID AND BattlerClass_ID = BattlerClassID AND PlayerID = " + playerId; BattlerClassData = new ComboBoxInputData("BattlerClassID", "Name", "Player_To_BattlerClass JOIN BaseObject JOIN BattlerClass", where, "BattlerClass_ID"); Class.Items.Clear(); Class.Items.AddRange(BattlerClassData.OptionsListNames.ToArray()); Class.SelectedIndex = 0; }