protected void Page_Load(object sender, EventArgs e) { myQuanlyhocEntities = new QuanlyhocEntities1(); var mySql = from i in myQuanlyhocEntities.KhoaDaoTaos select i; GridView1.DataSource = mySql.ToList(); GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { myQuanlyhocEntities = new QuanlyhocEntities1(); if (!IsPostBack) { var sQuery = from i in myQuanlyhocEntities.SinhViens select i; ddlMaSV.DataSource = sQuery.ToList(); ddlMaSV.DataValueField = "MaSV"; ddlMaSV.DataBind(); ddlMaSV_SelectedIndexChanged(sender, e); } }
protected void Page_Load(object sender, EventArgs e) { myQuanlyhocEntities = new QuanlyhocEntities1(); if (!IsPostBack) { var myQuery = from i in myQuanlyhocEntities.KhoaDaoTaos select i; ddlKhoa.DataSource = myQuery.ToList(); ddlKhoa.DataTextField = "TenKhoa"; ddlKhoa.DataValueField = "MaKhoa"; ddlKhoa.DataBind(); ddlKhoa_SelectedIndexChanged(sender, e); } }