Пример #1
0
        public ArrayList tumogrencilerigetir()
        {
            ArrayList ogrencitorbasi = new ArrayList();

            baglanti.Open();
            komut.Connection  = baglanti;
            komut.CommandText = "select * from ogrenciler order by ogadsoyad";
            SqlDataReader oku = komut.ExecuteReader();

            while (oku.Read())
            {
                Ogrenci ogr = new Ogrenci();
                ogr.Ogno      = Convert.ToInt32(oku["ogno"].ToString());
                ogr.Ogadsoyad = oku["ogadsoyad"].ToString();
                ogr.Tckimlik  = Convert.ToInt32(oku["tckimlik"].ToString());
                ogr.Dogtar    = Convert.ToDateTime(oku["dogtar"].ToString());
                ogr.Adres     = oku["adres"].ToString();
                ogrencitorbasi.Add(ogr);
            }
            baglanti.Close();
            return(ogrencitorbasi);
        }