Esempio n. 1
0
        public bool CreateDestinationDataTable()
        {
            Global.progressForm.UpdateForm(ProgressForm.LABEL_ACTION, "Creating destination table...");
            Global.ProgressForm.UpdateForm(ProgressForm.PROGRESSBAR_VALUE, "0");

            //Source database & table setup
            Database     sourceDb           = this.srcDb;
            TableOrQuery sourceTableOrQuery = this.sourceTable;

            sourceTableOrQuery = sourceDb.GetTableOrQueryByName(sourceTableOrQuery.GetName());
            sourceTableOrQuery.dataTable.TableName = sourceTableOrQuery.GetName();

            //Destination database & table setup
            Database  destinationDb = this.destDb;
            DataTable destinationDt;

            if (!this.isDspaceDestination)
            {
                Table destinationTable = destinationDb.GetTable(this.destTable.GetName());
                destinationTable.dataTable.TableName = destinationTable.GetName();
                destinationDt = destinationTable.dataTable;
            }
            else
            {
                destinationDt = ((DSpaceDatabase)destinationDb).dspaceData;
            }

            bool createDestinationDatatableSucess = Expression.AddValuesToDatatableDestination(sourceTableOrQuery.dataTable, destinationDt, this.expressionDt, Global.mapDt);

            return(createDestinationDatatableSucess);
        }
Esempio n. 2
0
        public bool FetchSourceData()
        {
            Global.progressForm.UpdateForm(ProgressForm.LABEL_ACTION, "Fetching source data...");

            Database     sourceDb           = this.srcDb;
            TableOrQuery sourceTableOrQuery = this.sourceTable;

            sourceDb.Close();
            sourceDb.Connect();
            int count = sourceDb.SelectRowCount(sourceTableOrQuery.GetName(), sourceTableOrQuery.type);

            Global.ProgressForm.UpdateForm(ProgressForm.PROGRESSBAR_VALUE, "0");
            Global.ProgressForm.UpdateForm(ProgressForm.PROGRESSBAR_MAXIMUM, count.ToString());
            bool selectDataSuccess = sourceDb.Select(sourceTableOrQuery.GetName(), sourceTableOrQuery.type);

            sourceDb.Close();
            return(selectDataSuccess);
        }