예제 #1
0
        private void dgvStoredProcs_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            if (e.RowIndex >= 0 && e.ColumnIndex == dgv.Columns["Execute"].Index)
            {
                if (this.bgTableQuery.IsBusy)
                {
                    if (DialogResult.Yes == MessageBox.Show("Cancel Table Query?", "StoredProcs", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                    {
                        this.bgTableQuery.CancelAsync();
                    }
                    else
                    {
                        return;
                    }
                }
                string dbName         = cmbDB.SelectedItem.ToString();
                string storedProcName = dgv.Rows[e.RowIndex].Cells["storedProcNameDataGridViewTextBoxColumn"].Value.ToString();

                List <StoredProcDetail.ParameterDetail> parameters       = StoredProcDetail.GetParameters(dbName, storedProcName);
                Dictionary <string, object>             parameterByValue = new Dictionary <string, object>();
                if (parameters.Count > 0)
                {
                    ExecStoredProcForm a = new ExecStoredProcForm(parameters);
                    a.ShowDialog();
                    if (!a.ContinueExecute)
                    {
                        return;
                    }
                    parameterByValue = a._ParameterByValue;
                }

                lblTable.Text         = string.Format("StoredProc:{0}", storedProcName);
                picBoxLoading.Visible = true;
                bwExecStoredProc.RunWorkerAsync(new StoredProcRequirement {
                    StoredProcName   = storedProcName,
                    DBName           = dbName,
                    ParameterByValue = parameterByValue
                });
            }
        }
예제 #2
0
 private void PopulateStoredProc(string dbName)
 {
     dgvStoredProcs.DataSource = StoredProcDetail.GetStoredProcs(dbName);
 }