public Casiers Lister() { Casiers liste = new Casiers(); con.Open(); try { IDbCommand com = con.CreateCommand(); com.CommandText = "SELECT * FROM Casier"; IDataReader reader = com.ExecuteReader(); while (reader.Read()) { Casier c = reader2Casier(reader); liste.Ajouter(c); } } finally { con.Close(); } return(liste); }
public Casiers Lister(Cave c) { Casiers liste = new Casiers(); con.Open(); try { IDbCommand com = con.CreateCommand(); com.CommandText = "SELECT * FROM Casier WHERE IdCave=" + c.Id.ToString(); IDataReader reader = com.ExecuteReader(); while (reader.Read()) { Casier cd = reader2Casier(reader); liste.Ajouter(cd); } } finally { con.Close(); } return(liste); }