예제 #1
0
        private Frage MkFrageObject(OleDbDataReader reader)
        {
            Frage f = new Frage();

            f.Id            = reader.GetInt32(0);
            f.Schwierigkeit = reader.GetInt32(1);
            f.Frage1        = reader.GetString(2);
            f.AntwortR      = reader.GetString(3);
            f.AntwortF1     = reader.GetString(4);
            f.AntwortF2     = reader.GetString(5);
            f.AntwortF3     = reader.GetString(6);
            return(f);
        }
예제 #2
0
        public void holeFrage()
        {
            schwierigkeit++;
            frageliste.Clear();
            Frage        f   = null;
            OleDbCommand cmd = con.CreateCommand();

            cmd.CommandText = "Select * from tFragen where Schwierigkeit = " + schwierigkeit;
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                f = MkFrageObject(reader);
                frageliste.Add(f);
            }
            //frageliste.Remove(f);
            anzeigezufälligeFrage();
        }