Please see this code
HTML
<asp:GridView ID="GridView1" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" ItemStyle-Width="30" />
<asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" />
<asp:BoundField DataField="DOB" HeaderText="Date Of Birth" ItemStyle-Width="200" />
</Columns>
</asp:GridView>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds.Tables.Add(new DataTable());
ds.Tables[0].Columns.AddRange(new DataColumn[3] { new DataColumn("Id", typeof(int)),
new DataColumn("Name", typeof(string)),
new DataColumn("DOB",typeof(DateTime)) });
ds.Tables[0].Rows.Add(1, "John Hammond", "12/12/1996");
ds.Tables[0].Rows.Add(2, "Mudassar Khan", "11/16/1995");
ds.Tables[0].Rows.Add(3, "Suzanne Mathews", "10/20/1997");
ds.Tables[0].Rows.Add(4, "Robert Schidner", "09/22/1991");
DataTable dt2 = new DataTable();
dt2 = ds.Tables[0].Select().Where(p => (Convert.ToDateTime(p["DOB"]) >= Convert.ToDateTime("12/12/1996")) && (Convert.ToDateTime(p["DOB"]) >= Convert.ToDateTime("12/12/1996"))).CopyToDataTable();
GridView1.DataSource = dt2;
GridView1.DataBind();
}
Screenshot