public ArrayList GetButunOgrenciler() { ArrayList eokulArray = new ArrayList(); MySqlDataReader reader = null; MySqlCommand command = new MySqlCommand("Select * From eOgrenci", connection); reader = command.ExecuteReader(); while (reader.Read()) { Eokul eokul = new Eokul(); eokul.OgrenciNo = reader.GetInt32(0); eokul.OgrenciAd = reader.GetString(1); eokul.OgrenciSoyad = reader.GetString(2); eokul.SinifNo = reader.GetInt32(3); eokul.DanismanAdi = reader.GetString(4); eokul.BolumId = reader.GetInt32(5); eokulArray.Add(eokul); } return(eokulArray); }
public Eokul GetEokul(int ogrenciNo) { Eokul eokul = new Eokul(); MySqlDataReader reader = null; MySqlCommand command = new MySqlCommand("Select * From eOgrenci Where ogrenciNo = '" + ogrenciNo + "'", connection); reader = command.ExecuteReader(); if (reader.Read()) { eokul.OgrenciNo = reader.GetInt32(0); eokul.OgrenciAd = reader.GetString(1); eokul.OgrenciSoyad = reader.GetString(2); eokul.SinifNo = reader.GetInt32(3); eokul.DanismanAdi = reader.GetString(4); eokul.BolumId = reader.GetInt32(5); return(eokul); } else { return(null); } }