public FRM_SUP() { InitializeComponent(); SMP.DB_SMPEntities1 dbContext = new SMP.DB_SMPEntities1(); // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database. dbContext.TB_SUP.LoadAsync().ContinueWith(loadTask => { // Bind data to control when loading complete gridControl1.DataSource = dbContext.TB_SUP.Local.ToBindingList(); }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); }
public FRM_CAT() { InitializeComponent(); // This line of code is generated by Data Source Configuration Wizard // Instantiate a new DBContext SMP.DB_SMPEntities1 dbContext = new SMP.DB_SMPEntities1(); // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database. dbContext.TB_CAT.LoadAsync().ContinueWith(loadTask => { // Bind data to control when loading complete gridControl1.DataSource = dbContext.TB_CAT.Local.ToBindingList(); }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); }