Beispiel #1
0
        public FRM_USER()
        {
            InitializeComponent();

            Sales_Management_Syastem.DB_SMPEntities dbContext = new Sales_Management_Syastem.DB_SMPEntities();
            // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database.
            dbContext.TB_USERS.LoadAsync().ContinueWith(loadTask =>
            {
                // Bind data to control when loading complete
                gridControl1.DataSource = dbContext.TB_USERS.Local.ToBindingList();
            }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
        }
Beispiel #2
0
 public FRM_SELL()
 {
     InitializeComponent();
     // This line of code is generated by Data Source Configuration Wizard
     // Instantiate a new DBContext
     Sales_Management_Syastem.DB_SMPEntities dbContext = new Sales_Management_Syastem.DB_SMPEntities();
     // Call the LoadAsync method to asynchronously get the data for the given DbSet from the database.
     dbContext.TB_SELL.LoadAsync().ContinueWith(loadTask =>
     {
         // Bind data to control when loading complete
         gridControl1.DataSource = dbContext.TB_SELL.Local.ToBindingList();
     }, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
 }