using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Entity;
using System.Data;
namespace between2date
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
using (var db = new NorthwindEntities())
{
DateTime dtFrom = Convert.ToDateTime("1/1/2535");
DateTime dtTo = Convert.ToDateTime("1/12/2536");
var ds = (from c in db.Employees
where c.HireDate >= dtFrom && c.HireDate <= dtTo
select c).ToList();
if (ds.Count() > 0)
{
this.GridView1.DataSource = ds;
}
}
}
}
}