Exemplo n.º 1
0
        public DataTable LayMaMH(string tenmh)
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "select MaMonHoc from MONHOC where TenMonHoc = N'" + tenmh + "'";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 2
0
        public DataTable ThemHSVaoLop(string TenLop)
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "EXEC dbo.ThemHSVaoLop '" + TenLop + "'";
                provider.Connect();
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 3
0
        public DataTable LayDSMonHoc()
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "select TenMonHoc from MONHOC";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 4
0
        public DataTable TIMHSBANGMA(string MaHocSinh)
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "EXEC dbo.TIMHSBANGMA '" + MaHocSinh + "'";
                provider.Connect();
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 5
0
        public DataTable LayTatCaBangDiem()
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "SELECT * FROM BANGDIEM";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 6
0
        public DataTable TIMKIEMTHEOHOTEN(string hoten)
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "SELECT HS.MaHocSinh, HS.HoTen, DSL.TenLop, HS.GioiTinh, HS.NgaySinh, HS.Email, HS.DiaChi FROM HOCSINH HS, KHOILOP KL, CHITIETDSLOP CTDSL, DANHSACHLOP DSL WHERE HS.MaHocSinh = CTDSL.MaHocSinh AND CTDSL.MaLop = DSL.MaLop AND DSL.MaKhoiLop = KL.MaKhoiLop and HS.HoTen like N'%" + hoten + "%'";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 7
0
        public DataTable ThamSo()
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "select * from THAMSO";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 8
0
        public DataTable TIMKIEMDSHS()
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "EXEC dbo.TIMKIEMDSHS";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 9
0
        public DataTable LayKhoiLop()
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "SELECT MaKhoiLop FROM KHOILOP";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }
Exemplo n.º 10
0
        public DataTable LayLopHoc(string makhoilop)
        {
            DBConnect provider = new DBConnect();

            try
            {
                string strSql = "SELECT TenLop FROM DANHSACHLOP where MaKhoiLop = '" + makhoilop + "'";
                provider.Connect();;
                DataTable dt = provider.Select(CommandType.Text, strSql);
                return(dt);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                provider.DisConnect();
            }
        }