AdHocSQL Class
User-form for ad-hoc SQL execution
Inheritance Hierarchy
- System.Windows.Forms.Form
- DBaddin.AdHocSQL
Namespace: DBaddinAssembly: DBaddin in (DBaddin.dll)
Syntax
public class AdHocSQL : Form
The AdHocSQL type exposes the following members.
Constructors
| Class | Summary | |
|---|---|---|
![]() | AdHocSQL(String, Int32) | create new AdHocSQL dialog |
Methods
| Name | Summary | |
|---|---|---|
![]() | AdHocSQL_KeyUp(Object, KeyEventArgs) | needed together with KeyPreview=True on form to simulate ESC canceling the form and catching this successfully (preventing closing when canceling an ongoing sql-command), also see DBDocumentation.vb |
![]() | AdHocSQL_Shown(Object, EventArgs) | execution of the selected ribbon dropdown command right after dialog has been set up, otherwise GUI elements are not available |
![]() | CloseBtn_Click(Object, EventArgs) | "Close": close dialog with Cancel result |
![]() | Database_KeyDown(Object, KeyEventArgs) | when being on the database also allow Ctrl-Enter |
![]() | Database_SelectionChangeCommitted(Object, EventArgs) | database changed |
![]() | Dispose(Boolean) | |
![]() | Environment_SelectionChangeCommitted(Object, EventArgs) | Change Environment in AdHocSQL |
![]() | Execute_Click(Object, EventArgs) | executing the SQL command and passing the results to the results pane |
![]() | executeSQL() | after confirmation for non select statements (DML), execute the command given in SQLText by running fill_dgv_Async |
![]() | fill_dgv_Async(CancellationToken) | opens connection, creates command from SQLText and calls ExecuteReaderAsync to asynchronously fill the AdHocSQLQueryResult datagridview |
![]() | fillDatabases() | fills all possible databases of current connection using db proprietary code in dbGetAllStr, data coming from field DBGetAllFieldName |
![]() | fillDatabasesAndSetDropDown() | fill the Database dropdown |
![]() | finishForm(DialogResult) | common procedure to close the form, regarding (canceling) a running excution |
![]() | InitializeComponent() | |
![]() | refresh_dgv(List<Object[]>) | refresh the datagrid view in the UI thread (using AdHocSQLQueryResult.BeginInvoke) |
![]() | SQLText_KeyDown(Object, KeyEventArgs) | keyboard shortcuts for executing (ctrl-return), Transfer (shift-return) and maybe other things in the future (auto-complete) |
![]() | SQLText_MouseDown(Object, MouseEventArgs) | show context menu for SQLText, displaying config menu as a MenuStrip |
![]() | Timer_Tick(Object, EventArgs) | to show progress during execution, add elapsedTime (accessed in fill_dgv_Async via Me.RowsReturned.Invoke) |
![]() | Transfer_Click(Object, EventArgs) | "Transfer": close dialog with OK result |
![]() | TransferType_KeyDown(Object, KeyEventArgs) | when being on the TransferType selection also allow Shift-Enter |
Properties
| Name | Summary | |
|---|---|---|
![]() | Database | |
![]() | LDatabase | |
![]() | LEnv1 |
Fields
| Name | Description | |
|---|---|---|
![]() | batchSize | |
![]() | components | |
![]() | cts | for cancelling the asynchronous execution of the SQL command |
![]() | elapsedTime | fetch elapsed time in Timer to show after completion |
![]() | myDBConnHelper | common connection settings factored in helper class |
![]() | propagatedFromDoc | needed to avoid escape key pressed in DBDocumentation from propagating to main AdHocSQL dialog (and closing this dialog therefore) |
![]() | rowsCount | for counting received rows during execution of query commands |
![]() | storedUserSetEnv | stored environment to reset after change |
![]() | Timer | Timer for progress display |
![]() | userSetDB | stored database to reset after change |






