Ejemplo n.º 1
0
        public List <Sekcija> getSections()
        {
            List <Sekcija> list = new List <Sekcija>();

            conn.Open();

            using (SQLiteCommand com = new SQLiteCommand(conn))
            {
                com.CommandText = "SELECT * FROM sections;";

                SQLiteDataReader reader = com.ExecuteReader();

                while (reader.Read())
                {
                    Sekcija a = new Sekcija();

                    a.id  = reader.GetInt32(0);
                    a.ime = reader.GetString(1);

                    list.Add(a);
                }

                com.Dispose();
            }

            conn.Close();

            return(list);
        }
Ejemplo n.º 2
0
        public List <Sekcija> returnsekcije()
        {
            List <Sekcija> sekcije = new List <Sekcija>();

            conn.Open();

            using (SQLiteCommand com = new SQLiteCommand(conn))
            {
                com.CommandText = "SELECT * FROM sections;";
                SQLiteDataReader getReader = com.ExecuteReader();

                while (getReader.Read())
                {
                    Sekcija a = new Sekcija();
                    a.id  = getReader.GetInt32(0);
                    a.ime = getReader.GetString(1);

                    sekcije.Add(a);
                }

                com.Dispose();
            }

            conn.Close();

            return(sekcije);
        }