public void LoadGrid()
        {
            AllCourseDetailsShowInGridView allCourseDetailsShowInGrid = new AllCourseDetailsShowInGridView();
            DataTable dt = allCourseDetailsShowInGrid.GetAllCourseDetails();

            allCourseListGrid.DataSource = dt;
            allCourseListGrid.DataBind();
        }
コード例 #2
0
        private void LoadInGrid()
        {
            AllCourseDetailsShowInGridView allcourseShow = new AllCourseDetailsShowInGridView();
            DataTable dt = allcourseShow.GetAllCourseDetails();

            if (dt.Rows.Count > 0)
            {
                allCourseGridView.DataSource = dt;
                allCourseGridView.DataBind();
            }
        }
コード例 #3
0
        protected void printButton_Click(object sender, EventArgs e)
        {
            try
            {
                AllCourseDetailsShowInGridView allcourseShow = new AllCourseDetailsShowInGridView();
                DataTable cPrint = allcourseShow.GetAllCourseDetails();
                if (cPrint.Rows.Count > 0)
                {
                    ReportDocument rd = new ReportDocument();
                    rd.Load(Server.MapPath("~/CrystalReport1.rpt"));
                    rd.SetDataSource(cPrint);

                    DAO.ReportClass.rc = rd;
                    Response.Redirect("ReportView.aspx");
                }
            }
            catch (Exception r)
            {
                Response.Write(r.Message);
            }
        }