Beispiel #1
0
        /*DETAILS       :Print all the continents
         * RETURN       :A list of continents
         * */
        public ArrayList printAllContinentCAD()
        {
            ArrayList lista = new ArrayList();

            ContinentClass conti = new ContinentClass();

            try
            {
                c.Open();

                SqlCommand com = new SqlCommand("Select * from ContinentTable", c);

                SqlDataReader dr = com.ExecuteReader();

                while (dr.Read())
                {
                    conti.NameContinent = dr["nameContinent"].ToString();

                    lista.Add(conti.NameContinent);
                }
            }
            catch (SqlException exp)
            {
                throw new Exception(exp.Message, null);
            }
            finally
            {
                c.Close();
            }

            return lista;
        }
Beispiel #2
0
 //Of copy
 public ContinentClass(ContinentClass conti)
 {
     nameContinent = conti.NameContinent;
 }