private void LoadGridView() { StoreDAO aDao = new StoreDAO(); List <Store> aStores = new List <Store>(); aStores = aDao.GetAllStore(); purchaseStoredataGridView.DataSource = aStores; }
private void itemNametextBox_TextChanged(object sender, EventArgs e) { if (itemNametextBox.Text == "" || string.IsNullOrEmpty(itemNametextBox.Text)) { StoreDAO aDao = new StoreDAO(); List <Store> aStores = new List <Store>(); aStores = aDao.GetAllStore(); purchaseStoredataGridView.DataSource = aStores; } else { StoreDAO aDao = new StoreDAO(); List <Store> aStores = new List <Store>(); aStores = aDao.GetAllStore(); List <Store> aastore = (from myRow in aStores.AsEnumerable() where myRow.ItemName.ToUpper().StartsWith(itemNametextBox.Text.ToUpper()) select myRow).ToList(); // DataView view = results.AsDataView(); purchaseStoredataGridView.DataSource = aastore; } }