private void loadAllCustomers() { using (var db = new DemoxOyEntities()) { var query = from a in db.asiakas select a; gridView.DataSource = query.ToList(); gridView.DataBind(); } }
private void groupByCountry(string country) { using (var db = new DemoxOyEntities()) { var query = from a in db.asiakas orderby a.maa select a; gridView.DataSource = query.ToList(); gridView.DataBind(); } }
private void loadFromCountry(String country) { using (var db = new DemoxOyEntities()) { var query = from a in db.asiakas where a.maa == country select a; gridView.DataSource = query.ToList(); gridView.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (var db = new DemoxOyEntities()) { var query = from t in db.asiakas select t.maa; // Valitaan uniikit maat DropDownListiin. ddMaat.DataSource = query.Distinct().ToList(); ddMaat.DataBind(); } } }