public static void LoadItemsSets() { lock (DatabaseHandler.ConnectionLocker) { var sqlText = "SELECT * FROM datas_items_sets"; var sqlCommand = new MySqlCommand(sqlText, DatabaseHandler.Connection); var sqlReader = sqlCommand.ExecuteReader(); while (sqlReader.Read()) { var set = new Models.Items.SetModel(); set.ID = sqlReader.GetInt16("ID"); set.ParseBonus(sqlReader.GetString("bonus")); set.ParseItems(sqlReader.GetString("items")); lock(SetsList) SetsList.Add(set); } sqlReader.Close(); } Utilities.Loggers.StatusLogger.Write(string.Format("Loaded @'{0}' items sets@ from the database !", SetsList.Count)); }
public static void LoadItemsSets() { var sqlText = "SELECT * FROM items_sets"; var sqlCommand = new MySqlCommand(sqlText, Program.DBHelper.Use()); var sqlReader = sqlCommand.ExecuteReader(); while (sqlReader.Read()) { var set = new Models.Items.SetModel() { ID = sqlReader.GetInt16("ID"), }; set.ParseBonus(sqlReader.GetString("bonus")); set.ParseItems(sqlReader.GetString("items")); SetsList.Add(set); } sqlReader.Close(); Utilities.Loggers.Status.Write(string.Format("Loaded '{0}' items sets from the database !", SetsList.Count)); }