Exemplo n.º 1
0
        public List <Expertise> getExpertise()
        {
            List <Expertise> expertise = new List <Expertise>();
            string           sql       = "SELECT * FROM expertise ORDER BY expertise.id;";

            try
            {
                connection.Open();
                SQLiteCommand    command = new SQLiteCommand(sql, connection);
                SQLiteDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Expertise xp = new Expertise(int.Parse(reader["id"].ToString()), reader["xp"].ToString());
                    expertise.Add(xp);
                }
                connection.Close();
                return(expertise);
            }
            catch (System.Exception)
            {
                connection.Close();
                return(null);
            }
        }