Beispiel #1
0
        //***************************************************************************
        // Private Methods
        //
        private void PopulateTableList()
        {
            this.lstSrcTables.BeginUpdate();
            this.lstSrcTables.Items.Clear();
            try
            {
                if (this._db.GetType().Name != "rsDbSql")
                {
                    throw new Exception("Export wizrd currently only support SQL database sources.");
                }

                rsDbSql  db   = (rsDbSql)this._db;
                string[] tbls = db.GetTableList(this._dbNm);
                for (int i = 0; i < tbls.Length; i++)
                {
                    this.lstSrcTables.Items.Add("T: " + tbls[i]);
                }

                string[] vws = db.GetViewList(this._dbNm);
                for (int i = 0; i < vws.Length; i++)
                {
                    this.lstSrcTables.Items.Add("V: " + vws[i]);
                }
            }
            catch (Exception ex)
            {
                CrossThreadUI.ShowMessageBox(this, "Unable to retrieve table names: " + ex.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                this.Dispose();
            }
            finally
            {
                this.lstSrcTables.EndUpdate();
            }
        }
 private void dataQuery_onExecuteStopped(object sender, EventArgs e)
 {
     this._execTimer.Stop();
     this._execTimer.Dispose();
     CrossThreadUI.SetEnabled(this.txtQuery, true);
     CrossThreadUI.SetEnabled(this.panConn, true);
     this.UpdateQueryTime(this.TimeTaken);
     this._dataQry.Dispose();
 }
        private void dataQuery_onResultComplete(object sender, EventArgs e)
        {
            SplitContainer splData = new SplitContainer();

            splData.Orientation      = Orientation.Horizontal;
            splData.Dock             = DockStyle.Fill;
            splData.SplitterDistance = this.splQuery.Panel2.ClientRectangle.Height / 3;
            splData.Panel1.Controls.Add(this._lastCreated);
            CrossThreadUI.InvokePropertyMethod(this._createParent, "Controls", "Add", splData);
            this._createParent = splData;
        }
 //***************************************************************************
 // Event Handlers
 //
 private void dataQuery_onExecuteStart(object sender, EventArgs e)
 {
     CrossThreadUI.SetEnabled(this.txtQuery, false);
     CrossThreadUI.SetEnabled(this.panConn, false);
     CrossThreadUI.SetPropertyValue(this.splQuery, "Panel2Collapsed", false);
     this._createParent = this.splQuery.Panel2;
     this.InvokeCollapsedPanelChanged();
     this.DestroyDatasource();
     this._execTimer          = new Timer();
     this._execTimer.Interval = 500;
     this._execTimer.Tick    += new EventHandler(execTimer_onTick);
     this._execTimer.Start();
     this.InvokeQueryStart();
 }
 private void UpdateQueryTime(TimeSpan time)
 {
     CrossThreadUI.SetPropertyValue(this.statusLabelTime, "Text", string.Format("{0}:{1}:{2}", time.Hours.ToString().PadLeft(2, '0'), time.Minutes.ToString().PadLeft(2, '0'), time.Seconds.ToString().PadLeft(2, '0')));
 }