private void cbDbNames_SelectedIndexChanged(object sender, EventArgs e) { sbDbNames.Text = ((DataTable)cbDbNames.ComboBox.DataSource).Rows[cbDbNames.SelectedIndex].ItemArray[0].ToString(); SetPTODataSource(sbDbNames.Text); //Workaround to refresh report this.reportViewer1.Reset(); this.reportViewer1.ServerReport.ReportPath = "/SQLPTOReports/SystemInfo"; this.reportViewer1.RefreshReport(); RefreshReport(); //Close PerfQuery window if it's open if (frmPerfQuery != null) { frmPerfQuery.Close(); frmPerfQuery.Dispose(); frmPerfQuery = null; } if (frmExpensiveQueriesAndPlans != null) { frmExpensiveQueriesAndPlans.Close(); frmExpensiveQueriesAndPlans.Dispose(); frmExpensiveQueriesAndPlans = null; } //cbDbNames.ComboBox.Hide(); reportViewer1.Focus(); }
private void toolStripSplitButton2_ButtonClick(object sender, EventArgs e) { if (frmPerfQuery == null || frmPerfQuery.IsDisposed) { frmPerfQuery = new frmPerfMonQueries(); } frmPerfQuery.DatabaseName = sbDbNames.Text; frmPerfQuery.ReportForm = this; //frmPerfQuery.Width = Screen.PrimaryScreen.Bounds.Width; //frmPerfQuery.Height = Screen. frmPerfQuery.WindowState = FormWindowState.Maximized; frmPerfQuery.Show(); frmPerfQuery.BringToFront(); }