private void buttonBindCustomersData_Click(object sender, EventArgs e) { //Force the Context object to get fresh data! objContext = new EntityFrameworkDemosProcessor.EntityFrameworkDemosEntities(); dataGridView2.DataSource = objContext.vCustomers ; //dataGridView2.Refresh(); You do not need to refresh the GridView manually! }
private void buttonBindProductsData_Click(object sender, EventArgs e) { //Force the Context object to get fresh data! objContext = new EntityFrameworkDemosProcessor.EntityFrameworkDemosEntities(); dataGridView1.DataSource = objContext.Products; }