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) | |
AdHocSQL_Shown(Object, EventArgs) | execution of ribbon entered command after dialog has been set up, otherwise GUI elements are not available | |
AdHocSQLQueryResult_DataError(Object, DataGridViewDataErrorEventArgs) | For non displayable data (blobs, etc.) that raise an exception, write out the exception in the data-grid cell tool-tip instead of lots of pop-ups | |
BackgroundWorker1_DoWork(Object, DoWorkEventArgs) | start sql command and load data into data table in the background (to show progress and have cancellation control) | |
BackgroundWorker1_RunWorkerCompleted(Object, RunWorkerCompletedEventArgs) | sql command finished, show results. All GUI related work needs to be done in the main thread | |
Close_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() | ||
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 busy background worker = sqlcmd) | |
InitializeComponent() | ||
SQLText_KeyDown(Object, KeyEventArgs) | keyboard shortcuts for executing (ctrl-return), Transfer (shift-return) and maybe other things in the future (auto-complete) | |
Timer1_Tick(Object, EventArgs) | show progress during BackgroundWorker1 execution | |
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 | |
---|---|---|
AdHocSQLQueryResult | ||
BackgroundWorker1 | ||
CloseBtn | ||
Database | ||
EnvSwitch | ||
Execute | ||
LDatabase | ||
LEnv1 | ||
RowsReturned | ||
SplitContainer1 | ||
SQLText | ||
Timer1 | ||
ToolTip1 | ||
Transfer | ||
TransferType |
Fields
Name | Description | |
---|---|---|
components | ||
dt | ||
elapsedTime | ||
myDBConnHelper | common connection settings factored in helper class | |
nonRowResult | ||
SqlCmd | ||
storedUserSetEnv | stored environment to reset after change | |
userSetDB | stored database to reset after change |