コード例 #1
0
        private void CreateGSP()
        {
            Access97ConnectionParameters connectionParameters = new Access97ConnectionParameters(@"|DataDirectory|\AppData\gsp.mdb", "", "");
            ConnectionWrapper            cw  = InitConnection("GSPConnection", connectionParameters);
            DataSourceWrapper            dsw = DataSourceWrapper.Create();

            dsw.Name       = "GSP";
            dsw.Connection = cw;
            this.DataSources.Add(dsw);
        }
コード例 #2
0
        private void CreateDepartmentsWorks()
        {
            Access97ConnectionParameters connectionParameters = new Access97ConnectionParameters(@"|DataDirectory|\AppData\Departments.mdb", "", "");
            ConnectionWrapper            cw  = InitConnection("DepartmentsConnection", connectionParameters);
            DataSourceWrapper            dsw = DataSourceWrapper.Create();

            dsw.Name       = "Departments";
            dsw.Connection = cw;
            QueryWrapper qwSalesPerson = QueryWrapper.Create();

            qwSalesPerson.OwnerDataSource = dsw;
            qwSalesPerson.Name            = "Departments";
            qwSalesPerson.Sql             = "select * from Departments";
            dsw.Queries.Add(qwSalesPerson);

            this.DataSources.Add(dsw);
        }
コード例 #3
0
        public void InitDataSource()
        {
            DataSourceWrapper dsw            = DataSourceWrapper.Create();
            IEditableObject   editableObject = dsw;

            editableObject.BeginEdit();
            bool acceptChanges = OpenDataSourceEditor(dsw);

            if (acceptChanges)
            {
                dsw.DoEndEdit();
                DataSources.Add(dsw);
                SelectedDataSource = dsw;
            }
            else
            {
                dsw.DoCancelEdit();
            }
        }
コード例 #4
0
        private void CreateNorthwind()
        {
            DataConnectionParametersBase connectionParameters = new Access97ConnectionParameters(@"|DataDirectory|\AppData\nwind.mdb", "", "");
            ConnectionWrapper            cw  = InitConnection("NorthwindConnection", connectionParameters);
            DataSourceWrapper            dsw = DataSourceWrapper.Create();

            dsw.Name       = "Northwind";
            dsw.Connection = cw;
            QueryWrapper qwCategories = QueryWrapper.Create();

            qwCategories.OwnerDataSource = dsw;
            qwCategories.Name            = "Categories";
            qwCategories.Sql             = "select * from Categories";
            dsw.Queries.Add(qwCategories);
            QueryWrapper qwProducts = QueryWrapper.Create();

            qwProducts.OwnerDataSource = dsw;
            qwProducts.Name            = "Products";
            qwProducts.Sql             = "select * from Products";
            dsw.Queries.Add(qwProducts);
            this.DataSources.Add(dsw);
        }