public static List <Animal> allAnimals() { string sql = "SELECT* FROM \"ANIMAL\""; DataSet ds = dsBySql(sql); List <Animal> toReturn = new List <Animal>(); foreach (DataRow item in ds.Tables[0].Rows) { toReturn.Add(DataConversions.AnimalFromDataRow(item)); } return(toReturn); }
/// <summary> /// Returns an animal based on AID. /// </summary> /// <param name="aid"></param> /// <returns></returns> public static Animal getAnimalByAid(int aid) { string sql = "SELECT * FROM \"ANIMAL\" WHERE \"AID\" = " + aid; DataSet ds = dsBySql(sql); try { return(DataConversions.AnimalFromDataRow(ds.Tables[0].Rows[0])); } catch { return(null); } }