private void bind() { d = new DemoEntities(); var v = from o in d.vreport1 select o; FormView1.DataSource = v.ToList(); FormView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { d = new DemoEntities(); if (!IsPostBack) { txtstart.Enabled = false; txtend.Enabled = false; ddldeptno.Enabled = false; var h = from e1 in d.DEPTDATAs select e1; List <DEPTDATA> i = h.ToList(); ddldeptno.DataSource = i; ddldeptno.DataTextField = "dname"; ddldeptno.DataValueField = "deptno"; ddldeptno.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { D = new DemoEntities(); }