private void sqlButtonRun_Click(object sender, EventArgs e) { try { grid.DataSource = Dbo.GetTable(sqlTextBox.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void similarBookTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string title = "\'" + similarBookTextBox.Text + "\'"; try { grid.DataSource = Dbo.GetTable(String.Format("SELECT * from find_similar(" + title + ")")); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void ShowNodeTable() { if (lastIsView) { lastTable = Dbo.GetTable(lastTableName, GetAllConditionals()); grid.DataSource = lastTable; } else if (lastSelectedNode.Parent == null) { lastTableName = lastSelectedNode.Text; lastTable = Dbo.GetTable(lastSelectedNode.Text, GetAllConditionals()); grid.DataSource = lastTable; SetEditable(false); } else { lastTableName = lastSelectedNode.Parent.Text; lastTable = Dbo.GetTable(lastSelectedNode.Parent.Text, GetAllConditionals()); grid.DataSource = Dbo.GetTable(lastSelectedNode.Parent.Text, GetAllConditionals(), lastSelectedNode.Text); SetEditable(false); } ShowAddNewRow(lastTable); }