Beispiel #1
0
        private void dtgDataBaseDiff_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            try
            {
                log.Debug("dtgTables_MouseUp");
                DataGrid.HitTestInfo hti = this.dtgDataBaseDiff.HitTest(e.X, e.Y);
                string selectedTable = "";

                if (hti.Type == DataGrid.HitTestType.Cell &&(hti.Column == 0 || hti.Column == 1))
                {
                    selectedTable = (string)this.dtgDataBaseDiff[hti.Row, 0];
                    log.Debug("SelectedTable: " + selectedTable);

                    Compare comparer = new Compare(Global.Serv1.Databases[Global.SelectedDB], Global.Serv1.Databases[Global.SelectedDBCompare]);
                    ArrayList rep = new ArrayList();
                    DiffList_TextFile sourceText = null;
                    DiffList_TextFile targetText = null;

                    comparer.GetTableDiffReport(selectedTable,out sourceText,out targetText,out rep);

                    DiffResults results = new DiffResults(sourceText, targetText, rep, 0);
                    results.ShowDialog();
                    results.Dispose();
                }
            }
            catch (System.Exception ex)
            {
                log.Error(ex);
            }
       
        }
Beispiel #2
0
		private void btnCompare_Click(object sender, System.EventArgs e)
		{
			try
			{
				this.lblLeftDatabase.Text = " Table exists only in " + Global.SelectedDB;
				this.lblRightDatabase.Text = " Table exists only in " + Global.SelectedDBCompare ;

				Compare comparer = new Compare(Global.Serv1.Databases[Global.SelectedDB],Global.Serv1.Databases[Global.SelectedDBCompare]);
				DataTable compareTable = comparer.Overview;

                DataView vuCompare = new DataView(compareTable, "", "Name", DataViewRowState.CurrentRows);
				this.dtgDataBaseDiff.DataSource = vuCompare;
				statBar.Text = "";
			}
			catch(System.Exception ex)
			{
				statBar.Text = ex.ToString();
			}
		}