private void TabOpenFile() { Stream stream; OpenFileDialog dlg = new OpenFileDialog() { Filter = "SQL files (*.sql)|*.sql|All files (*)|*", FilterIndex = 1, RestoreDirectory = true }; if (dlg.ShowDialog() == DialogResult.OK) { if ((stream = dlg.OpenFile()) != null) { string fileName = dlg.FileName; try { string buffer = File.ReadAllText(fileName); ActiveSqlSession.Editor.Text = buffer; ActiveSqlSession.InitDatabase(ActiveSessionProviderDetails); } catch (Exception ex) { MessageBox.Show("An issue occurred attempting to open file.\n\r" + ex.Message); } } } }
/// <summary>Execute based upon currently selected database path</summary> private void ExecuteQuery() { // 1. Ensure we're executing against selected DB from dropdown ActiveSqlSession.InitDatabase(ActiveSessionProviderDetails); // 2. Execute //TODO: ExecuteQuery via Thread-safe operation ActiveSqlSession.Execute(); // 3. Ensure we're returning feedback via EventHandler }
private void MenuEditPaste_Click(object sender, EventArgs e) { ActiveSqlSession.Paste(); }
private void MenuEditCut_Click(object sender, EventArgs e) { ActiveSqlSession.Cut(); }