Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Populate the "Suppliers" data table with data.
            adapter.Fill(dataSet.Suppliers);
            IWorkbook workbook = spreadsheetControl1.Document;

            // Load the template document into the SpreadsheetControl.
            workbook.LoadDocument("Suppliers_template.xlsx");
            Worksheet sheet = workbook.Worksheets[0];

            // Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
            sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1);
        }
Ejemplo n.º 2
0
 void buttonCancelChanges_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     // Close the cell in-place editor if it's currently active.
     CloseInplaceEditor();
     // Load the latest saved data into the "Suppliers" data table.
     adapter.Fill(dataSet.Suppliers);
 }
Ejemplo n.º 3
0
 //一个填充Northwind数据库中产品和供应商到DataSet中去的函数
 protected void FillDataSet()
 {
     ProductsTableAdapter productadapter = new ProductsTableAdapter();
     productadapter.Fill(ds.Products);
     SuppliersTableAdapter supplieradapter = new SuppliersTableAdapter();
     supplieradapter.Fill(ds.Suppliers);
 }
Ejemplo n.º 4
0
    //一个填充Northwind数据库中产品和供应商到DataSet中去的函数
    protected void FillDataSet()
    {
        ProductsTableAdapter productadapter = new ProductsTableAdapter();

        productadapter.Fill(ds.Products);
        SuppliersTableAdapter supplieradapter = new SuppliersTableAdapter();

        supplieradapter.Fill(ds.Suppliers);
    }
Ejemplo n.º 5
0
        //connection to the database
        private void get_data()
        {
            ds = new DataSet1();

            st = new InventoryTableAdapter();
            st.Fill(ds.Inventory);

            ct = new SuppliersTableAdapter();
            ct.Fill(ds.Suppliers);

            et = new EmployeesTableAdapter();
            et.Fill(ds.Employees);
        }
Ejemplo n.º 6
0
        private void BindWorksheetToDataSource()
        {
            dataSet = new NWindDataSet();
            adapter = new SuppliersTableAdapter();
            // Populate the "Suppliers" data table with data.
            adapter.Fill(dataSet.Suppliers);

            IWorkbook workbook = spreadsheetControl.Document;

            // Load the template document into the SpreadsheetControl.
            workbook.LoadDocument("Documents\\Suppliers_template.xlsx", DocumentFormat.Xlsx);
            Worksheet sheet = workbook.Worksheets[0];

            // Load data from the "Suppliers" data table into the worksheet starting from the cell "B12".
            sheet.DataBindings.BindToDataSource(dataSet.Suppliers, 11, 1);
        }
Ejemplo n.º 7
0
        /*
         * Function get_data()
         * Fills database tables using DataSet.
         */
        private void get_data()
        {
            ds   = new DataSet1();
            mt   = new MenuTableAdapter();
            it   = new InventoryTableAdapter();
            et   = new EmployeesTableAdapter();
            ot   = new OrdersTableAdapter();
            olt  = new OrderlineTableAdapter();
            st   = new SuppliersTableAdapter();
            pot  = new PurchaseOrdersTableAdapter();
            polt = new PurchaseOrderlineTableAdapter();

            mt.Fill(ds.Menu);
            it.Fill(ds.Inventory);
            et.Fill(ds.Employees);
            ot.Fill(ds.Orders);
            olt.Fill(ds.Orderline);
            st.Fill(ds.Suppliers);
            pot.Fill(ds.PurchaseOrders);
            polt.Fill(ds.PurchaseOrderline);
        }