public C_t_specialites Lire_ID(int IDSpe) { CreerCommande("Selectionnert_specialites_ID"); Commande.Parameters.AddWithValue("@IDSpe", IDSpe); Commande.Connection.Open(); SqlDataReader dr = Commande.ExecuteReader(); C_t_specialites res = new C_t_specialites(); while (dr.Read()) { res.IDSpe = int.Parse(dr["IDSpe"].ToString()); res.NomSpe = dr["NomSpe"].ToString(); } dr.Close(); Commande.Connection.Close(); return(res); }
public List <C_t_specialites> Lire(string Index) { CreerCommande("Selectionnert_specialites"); Commande.Parameters.AddWithValue("@Index", Index); Commande.Connection.Open(); SqlDataReader dr = Commande.ExecuteReader(); List <C_t_specialites> res = new List <C_t_specialites>(); while (dr.Read()) { C_t_specialites tmp = new C_t_specialites(); tmp.IDSpe = int.Parse(dr["IDSpe"].ToString()); tmp.NomSpe = dr["NomSpe"].ToString(); res.Add(tmp); } dr.Close(); Commande.Connection.Close(); return(res); }