AdHocSQL Methods

The AdHocSQL type exposes the following members.

Methods

NameSummary
private methodAdHocSQL_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
private methodAdHocSQL_Shown(Object, EventArgs)
execution of the selected ribbon dropdown command right after dialog has been set up, otherwise GUI elements are not available
private methodCloseBtn_Click(Object, EventArgs)
"Close": close dialog with Cancel result
private methodDatabase_KeyDown(Object, KeyEventArgs)
when being on the database also allow Ctrl-Enter
private methodDatabase_SelectionChangeCommitted(Object, EventArgs)
database changed
protected methodDispose(Boolean)
private methodEnvironment_SelectionChangeCommitted(Object, EventArgs)
Change Environment in AdHocSQL
private methodExecute_Click(Object, EventArgs)
executing the SQL command and passing the results to the results pane
private methodexecuteSQL()
after confirmation for non select statements (DML), execute the command given in SQLText by running fill_dgv_Async
public methodfill_dgv_Async(CancellationToken)
opens connection, creates command from SQLText and calls ExecuteReaderAsync to asynchronously fill the AdHocSQLQueryResult datagridview
private methodfillDatabases()
fills all possible databases of current connection using db proprietary code in dbGetAllStr, data coming from field DBGetAllFieldName
private methodfillDatabasesAndSetDropDown()
fill the Database dropdown
private methodfinishForm(DialogResult)
common procedure to close the form, regarding (canceling) a running excution
private methodInitializeComponent()
private methodrefresh_dgv(List<Object[]>)
refresh the datagrid view in the UI thread (using AdHocSQLQueryResult.BeginInvoke)
private methodSQLText_KeyDown(Object, KeyEventArgs)
keyboard shortcuts for executing (ctrl-return), Transfer (shift-return) and maybe other things in the future (auto-complete)
private methodSQLText_MouseDown(Object, MouseEventArgs)
show context menu for SQLText, displaying config menu as a MenuStrip
public methodTimer_Tick(Object, EventArgs)
to show progress during execution, add elapsedTime (accessed in fill_dgv_Async via Me.RowsReturned.Invoke)
private methodTransfer_Click(Object, EventArgs)
"Transfer": close dialog with OK result
private methodTransferType_KeyDown(Object, KeyEventArgs)
when being on the TransferType selection also allow Shift-Enter