コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            KCOT.DataSet dataSet = ((KCOT.DataSet)(this.FindResource("dataSet")));
            // Load data into the table ZAP. You can modify this code as needed.
            KCOT.DataSetTableAdapters.ZAPTableAdapter dataSetZAPTableAdapter = new KCOT.DataSetTableAdapters.ZAPTableAdapter();
            dataSetZAPTableAdapter.Fill(dataSet.ZAP);
            System.Windows.Data.CollectionViewSource zAPViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("zAPViewSource")));
            zAPViewSource.View.MoveCurrentToFirst();
            // Load data into the table TIP_ZAP. You can modify this code as needed.
            KCOT.DataSetTableAdapters.TIP_ZAPTableAdapter dataSetTIP_ZAPTableAdapter = new KCOT.DataSetTableAdapters.TIP_ZAPTableAdapter();
            dataSetTIP_ZAPTableAdapter.Fill(dataSet.TIP_ZAP);
            System.Windows.Data.CollectionViewSource tIP_ZAPViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("tIP_ZAPViewSource")));
            tIP_ZAPViewSource.View.MoveCurrentToFirst();

            // Load is an extension method on IQueryable,
            // defined in the System.Data.Entity namespace.
            // This method enumerates the results of the query,
            // similar to ToList but without creating a list.
            // When used with Linq to Entities this method
            // creates entity objects and adds them to the context.
            _context.TIP_ZAP.Load();
            _context.ZAPs.Load();
            // After the data is loaded call the DbSet<T>.Local property
            // to use the DbSet<T> as a binding source.
            tIP_ZAPViewSource.Source = _context.TIP_ZAP.Local;
            zAPViewSource.Source     = _context.ZAPs.Local;
        }
コード例 #2
0
ファイル: PocetnaOrg.xaml.cs プロジェクト: ImolaFodor/KCOT
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dataSet = ((KCOT.DataSet)(this.FindResource("dataSet")));

            // Load data into the table DOGADJAJ. You can modify this code as needed.
            dataSetDOGADJAJTableAdapter = new KCOT.DataSetTableAdapters.DOGADJAJTableAdapter();
            dataSetDOGADJAJTableAdapter.Fill(dataSet.DOGADJAJ);
            System.Windows.Data.CollectionViewSource dOGADJAJViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("dOGADJAJViewSource")));
            dOGADJAJViewSource.View.MoveCurrentToFirst();
        }