// 委托
        public delegate void ShowProgressBar(long total, long current);
        // 事件
        public event ShowProgressBar showProgressBar;


        void Show_ProgressBar(long total, long current)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new ShowProgressBar(Show_ProgressBar), new object[] { total, current });
            }
            else
            {
                this.progressBarImport.Maximum = (int)total;
                this.progressBarImport.Value = (int)current;
            }
        }

        public void ImportStart()
        {
            this.showProgressBar = new ShowProgressBar(Show_ProgressBar);
            //buttonImport.Enabled = false;
            try
            {
                sqlDB.Open();
                oracleDB.Open();
                ArrayList al = sqlDB.getDataBaseTables();
                for (int i = 0; i < al.Count; i++)
                {
                    showProgressBar(al.Count, i);
                    InsertDataTableToTable(al[i].ToString());
                }
                Thread.CurrentThread.Abort();
            }
            finally
            {
                sqlDB.Close();
                oracleDB.Close();
            }
            //buttonImport.Enabled = true;
        }

相关文章:

  • 2022-01-07
  • 2021-08-03
  • 2021-07-31
  • 2021-09-09
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-12
  • 2021-12-14
  • 2022-12-23
  • 2021-05-13
  • 2021-09-22
  • 2022-12-23
相关资源
相似解决方案