SqlConnection myconn; SqlCommand cmd; protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { DropDownList ddl1 = PreviousPage.FindControl("ddlyear") as DropDownList; DropDownList ddl2 = PreviousPage.FindControl("ddlsem") as DropDownList; DropDownList ddl3 = PreviousPage.FindControl("ddlsubid") as DropDownList; DropDownList ddl4 = PreviousPage.FindControl("ddltype") as DropDownList; DropDownList ddl5 = PreviousPage.FindControl("ddlmonth") as DropDownList; myconn = new SqlConnection(@"Data Source=TIMSCDR\SQLEXPRESS;Initial Catalog=IAP;Integrated Security=True"); myconn.Open(); string str4 = "select stuid,present,absent,working from attendance1 where year = '" + ddl1.Text + "' and sem = '" + ddl2.Text + "' and subid = '" + ddl3.Text + "' and type = '" + ddl4.Text + "' and month = '" + ddl5.Text + "'"; cmd = new SqlCommand(str4, myconn); SqlDataAdapter da4 = new SqlDataAdapter(cmd); DataSet ds4 = new DataSet(); da4.Fill(ds4, "DataTable1"); ReportDocument report = new ReportDocument(); report.Load(Server.MapPath("CrystalReport1.rpt")); report.SetDataSource(ds4); CrystalReportViewer1.ReportSource = report; myconn.Close(); } }
Table1
DataTable dt = new DataTable("Table1");
Dataset1
DataSet ds = new DataSet1("Dataset1");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)