public void LoadGrid() { AllCourseDetailsShowInGridView allCourseDetailsShowInGrid = new AllCourseDetailsShowInGridView(); DataTable dt = allCourseDetailsShowInGrid.GetAllCourseDetails(); allCourseListGrid.DataSource = dt; allCourseListGrid.DataBind(); }
private void LoadInGrid() { AllCourseDetailsShowInGridView allcourseShow = new AllCourseDetailsShowInGridView(); DataTable dt = allcourseShow.GetAllCourseDetails(); if (dt.Rows.Count > 0) { allCourseGridView.DataSource = dt; allCourseGridView.DataBind(); } }
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); } }