public List <Rayon> GetRayonParSecteur(int numS) { List <Rayon> mesRayons = new List <Rayon>(); cmd = new MySqlCommand("select numr, nomr from rayon where numsecteur = " + numS, cnx); dr = cmd.ExecuteReader(); while (dr.Read()) { Rayon uneCateg = new Rayon(Convert.ToInt16(dr[0].ToString()), dr[1].ToString()); mesRayons.Add(uneCateg); } dr.Close(); return(mesRayons); }
public List <Rayon> GetAllRayons() { List <Rayon> mesRayons = new List <Rayon>(); cmd = new MySqlCommand("select numr, nomr from rayon", cnx); dr = cmd.ExecuteReader(); while (dr.Read()) { Rayon unRayon = new Rayon(Convert.ToInt16(dr[0].ToString()), dr[1].ToString()); mesRayons.Add(unRayon); } dr.Close(); return(mesRayons); }