public static void Initialize() { using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Data)) { //method for getting count string query = "SELECT COUNT(num) FROM npc"; DataColumnCollection row = dbConnection.Database.RetrieveRow(query); int count = row["COUNT(num)"].ValueString.ToInt(); npcs = new NpcCollection(count); } }