private void bindGrid() { string resourceType = "image"; resourceType = ""; DateTime startDate; if (!DateTime.TryParse(this.t_Date.Text, out startDate)) { startDate = DateTime.MinValue; } DateTime endDate; if (!DateTime.TryParse(this.e_Date.Text, out endDate)) { endDate = DateTime.MaxValue; } endDate = endDate.AddDays(1); Resource obj = new Resource(); DataTable dt=obj.GetDownloadStatic(resourceType, startDate, endDate); if (dt != null) { this.GridView1.DataSource = dt.DefaultView; this.GridView1.DataBind(); } }