Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var sb = new StringBuilder();
            var c  = getFromCreator();

            foreach (var t in _tables)
            {
                sb.AppendLine("/***************************************************************/");
                sb.AppendLine("/****************     <" + t.TableName + ">    *****************/");
                sb.AppendLine("/***************************************************************/");
                sb.AppendLine("insert into GRINGLOBAL." + t.TableName + " (");
                var sbSelect = new StringBuilder();
                foreach (var f in t.Fields)
                {
                    sb.Append(f.Name + ", ");
                    sbSelect.Append(f.Name + ", ");
                }
                sb.Length       -= 2;
                sbSelect.Length -= 2;
                sb.AppendLine(")").AppendLine("   select " + sbSelect.ToString()).AppendLine(" from PROD." + t.TableName + ")");
                sb.AppendLine("/");
                sb.AppendLine();
                sb.AppendLine();
            }
            var form = new frmPreview();

            form.txtPreview.Text = sb.ToString();
            form.ShowDialog(this);
        }
Beispiel #2
0
        private void backgroundProgress(object sender, ProgressChangedEventArgs e)
        {
            ProgressEventArgs pea = (ProgressEventArgs)e.UserState;

            if (pea.Message.StartsWith("SCHEMA:"))
            {
                string     schema = pea.Message.Substring("SCHEMA:".Length);
                frmPreview fp     = new frmPreview();
                fp.txtPreview.Text            = schema;
                fp.txtPreview.SelectionStart  = 0;
                fp.txtPreview.SelectionLength = 0;
                fp.Show(this);
            }
            else
            {
                statusText.Text = pea.Message;
                if (pea.TotalItems > 0)
                {
                    statusProgress.Value = (int)(((double)pea.ItemOffset / (double)pea.TotalItems) * (double)100);
                }
            }
            //} else if (pea.Message.StartsWith("PERCENT:")) {
            //    } else if (pea.Message.StartsWith("TICK:")){
            //        updateTimer();
            //} else if (pea.Message.StartsWith("Copying data for")) {
            //    lbProgress.Items.Add(pea.Message);
            //    lbProgress.SelectedIndex = lbProgress.Items.Count - 1;
            //    _tableCount++;
            //    lblTotalProgress.Text = "Table " + _tableCount + " of " + this.lvTablesTo.CheckedItems.Count;
            //} else {
            //    lbProgress.Items.Add(pea.Message);
            //    lbProgress.SelectedIndex = lbProgress.Items.Count - 1;
            //}
        }
Beispiel #3
0
        void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            ProgressEventArgs pea = (ProgressEventArgs)e.UserState;

            if (pea.Message.StartsWith("SCHEMA:"))
            {
                string     schema = pea.Message.Substring("SCHEMA:".Length);
                frmPreview fp     = new frmPreview();
                fp.txtPreview.Text            = schema;
                fp.txtPreview.SelectionStart  = 0;
                fp.txtPreview.SelectionLength = 0;
                fp.ShowDialog(this);
            }
            else if (pea.Message.StartsWith("PERCENT:"))
            {
                lblStatus.Text = pea.Message.Substring("PERCENT:".Length);
                //} else if (pea.Message.StartsWith("TICK:")){
                //    updateTimer();
            }
            else if (pea.Message.StartsWith("Copying data for"))
            {
                lbProgress.Items.Add(pea.Message);
                lbProgress.SelectedIndex = lbProgress.Items.Count - 1;
                _tableCount++;
                lblTotalProgress.Text = "Table " + _tableCount + " of " + this.lvTablesTo.CheckedItems.Count;
            }
            else
            {
                lbProgress.Items.Add(pea.Message);
                lbProgress.SelectedIndex = lbProgress.Items.Count - 1;
            }
        }
Beispiel #4
0
 private void lbProgress_DoubleClick(object sender, EventArgs e)
 {
     if (lbProgress.SelectedItem != null)
     {
         frmPreview fp = new frmPreview();
         fp.txtPreview.Text = lbProgress.SelectedItem.ToString();
         fp.ShowDialog();
     }
 }
Beispiel #5
0
        private void btnPreviewList_Click(object sender, EventArgs e)
        {
            Creator c = Creator.GetInstance(new DataConnectionSpec {
                ConnectionString = cboConnectionStringFrom.Text, ProviderName = getFromProviderName(), CommandTimeout = COMMAND_TIMEOUT
            });

            lvFromTables.Items.Clear();
            List <string> names = c.ListTableNames(txtFromDatabaseOwner.Text);

            frmPreview fp = new frmPreview();

            fp.txtPreview.Text = "DESCRIBE " + String.Join(";\r\nDESCRIBE ", names.ToArray()) + ";";
            fp.ShowDialog(this);
        }