Exemple #1
0
        public ArrayList StageExam_GetAll()
        {
            ArrayList lst = new ArrayList();

            using (SqlConnection conn = getConnect())
            {
                //SqlCommand cmd = new SqlCommand("select * " +
                //    "from dethi, kyThi, monHoc " +
                //    "where dethi.makythi = kyThi.makythi " +
                //    "and dethi.mamon = monHoc.mamon", conn);
                SqlCommand    cmd = new SqlCommand("select * from kyThi", conn);
                SqlDataReader dr  = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        DbExam obj = new DbExam();
                        obj.stageExamAll_IDataReader(dr);
                        lst.Add(obj);
                    }
                }
            }

            return(lst);
        }
Exemple #2
0
        public ArrayList getStageById(string id)
        {
            ArrayList lst = new ArrayList();

            using (SqlConnection conn = getConnect())
            {
                SqlCommand    cmd = new SqlCommand("select * from kyThi where makythi = '" + id + "'", conn);
                SqlDataReader dr  = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        DbExam obj = new DbExam();
                        obj.stageExamAll_IDataReader(dr);
                        lst.Add(obj);
                    }
                }
            }
            return(lst);
        }