protected void Page_Load(object sender, EventArgs e) { T = new TestEntities(); if (!IsPostBack) { txtStart.Enabled = false; txtEnd.Enabled = false; ddlDeptno.Enabled = false; var E = from E1 in T.DEPTDATAs select E1; List <DEPTDATA> L = E.ToList(); ddlDeptno.DataSource = L; ddlDeptno.DataTextField = "Dname"; ddlDeptno.DataValueField = "deptno"; ddlDeptno.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { T = new TestEntities(); }