<br /> I have to display the gridview by filtering data in between two dates.<br /> When I was running this code the gridview is not displaying.<br /> no error message.<br /> So give me solution to find the error.<br /> <br />
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.IO; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html; using iTextSharp.text.html.simpleparser; namespace WebApplication1 { public partial class Reporting_Mopdule : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { solarDataSet2TableAdapters.tbl_energy_reportTableAdapter state; state = new solarDataSet2TableAdapters.tbl_energy_reportTableAdapter(); DataTable dt = new DataTable(); dt = state.GetStateDataBy(); DropDownList1.DataSource = dt; DropDownList1.DataTextField = "State"; DropDownList1.DataValueField = "State"; DropDownList1.DataBind(); } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { solarDataSet2TableAdapters.tbl_energy_reportTableAdapter state; state = new solarDataSet2TableAdapters.tbl_energy_reportTableAdapter(); DataTable dt = new DataTable(); dt = state.GetClusterDataBy(DropDownList1.SelectedValue); DropDownList2.DataSource = dt; DropDownList2.DataTextField = "Cluster"; DropDownList2.DataValueField = "Cluster"; DropDownList2.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { DateTime dt1 = Convert.ToDateTime(TextBox1_CalendarExtender.SelectedDate); DateTime dt2 = Convert.ToDateTime(TextBox2_CalendarExtender.SelectedDate); solarDataSet2TableAdapters.tbl_energy_reportTableAdapter state; state = new solarDataSet2TableAdapters.tbl_energy_reportTableAdapter(); DataTable dt = new DataTable(); dt = state.GetGridDataBy(DropDownList1.SelectedValue.ToString(), dt1.ToString(), dt2.ToString(), DropDownList2.SelectedValue.ToString()); GridView1.DataSource = dt; GridView1.DataBind(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)