/// <summary> /// Default Routine to update information on Form /// </summary> public void LoadData() { dtTable = new MyTableList(SQLDwConfig); this.dgvTables.DataSource = dtTable.GetTableList(); cmbDataType.Items.Clear(); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_ALL); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_DWH_TABLE_CREATE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_EXTERNAL_TABLE_CREATE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_INSERT_FROM_EXT_TABLE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_DWH_TABLE_DROP); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_EXTERNAL_TABLE_DROP); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_DWH_TABLE_TRUNCATE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_AZURE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_BCP); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_TABLE_REFACTOR); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_BCP_EMPTY_FILE); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_DWH_TABLE_CREATE_DROP); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_EXTERNAL_TABLE_CREATE_DROP); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_SELECT_SQL); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_FILE_HEADER); cmbDataType.Items.Add(Constants.SCRIPT_TYPE_SQL_ETL); cmbDataType.SelectedIndex = 0; this.sbpConfig.Text = CurrentConfigFileName; this.sbpServer.Text = SQLDwConfig.ServerName; this.sbpDatabase.Text = SQLDwConfig.DatabaseName; optSelectAll.Checked = true; this.dgvTables.Columns[MyTableList.SCHEMA_NAME].ReadOnly = true; this.dgvTables.Columns[MyTableList.TABLE_NAME].ReadOnly = true; this.dgvTables.Columns[MyTableList.TOTAL_ROWS].ReadOnly = true; this.dgvTables.Columns[MyTableList.DATA_SIZE_MB].ReadOnly = true; this.dgvTables.Columns[MyTableList.DISTRIBUTION_TYPE].ReadOnly = true; this.dgvTables.Columns[MyTableList.DISTRIBUTION_COLUMN].ReadOnly = true; this.dgvTables.Columns[MyTableList.INDEX_TYPE].ReadOnly = true; this.dgvTables.Columns[MyTableList.INDEX_COLUMN].ReadOnly = true; this.dgvTables.Columns[MyTableList.BCP_SPLIT].ReadOnly = true; this.dgvTables.Columns[MyTableList.BCP_SPLIT_COLUMN].ReadOnly = true; this.dgvTables.Columns[MyTableList.BCP_SPLIT_VALUES].ReadOnly = true; this.dgvTables.Columns[MyTableList.REPLACE_CRLF].ReadOnly = true; this.dgvTables.Columns[MyTableList.BCP_SPLIT_VALUE_TYPE].ReadOnly = true; this.dgvTables.Columns[MyTableList.SELECT].ReadOnly = false; //Initial formatting for DataGrid this.dgvTables.Columns[MyTableList.TOTAL_ROWS].DefaultCellStyle.Format = "#,##0"; this.dgvTables.Columns[MyTableList.DATA_SIZE_MB].DefaultCellStyle.Format = "#,##0"; this.dgvTables.Columns[MyTableList.TOTAL_ROWS].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; this.dgvTables.Columns[MyTableList.DATA_SIZE_MB].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; this.dgvTables.Columns[MyTableList.TABLE_ID].Visible = false; }
/// <summary> /// Load the Table list from the database. This will return the current state /// </summary> private void LoadTableListFromDatabase() { dtTable.RefreshTableListFromDB(SQLDwConfig); this.dgvTables.DataSource = dtTable.GetTableList(); }