private void BtnNext_Click(object sender, EventArgs e) { string qry = txtQRY.Text; if (qry.Substring(0, 6).ToUpper() == "SELECT" || qry.Substring(0, 4).ToUpper() == "SHOW") { try { frmQueryResults qr = new frmQueryResults(dc, qry); qr.Show(); } catch (Exception) { } } else { try { dc.SqlExecute(qry); MessageBox.Show("Query Execution Complete"); } catch (Exception ex) { MessageBox.Show("Query Failed\n" + qry + "\n" + ex.ToString()); this.Close(); } } }
private void showTablesToolStripMenuItem_Click(object sender, EventArgs e) { if (mc != null) { try { frmQueryResults qr = new frmQueryResults(mc, "Show Tables;"); qr.Show(); } catch (Exception) { } } else if (jc != null) { try { frmShowJetTables sjt = new frmShowJetTables(jc); sjt.Show(); } catch (Exception) {} } else if (lc != null) { try { frmQueryResults qr = new frmQueryResults(lc, "SELECT NAME from sqlite_master;"); qr.Show(); } catch (Exception) { } } }
private void Proceed() { try { MySQLConnection mc = (MySQLConnection)dc; string qry = "SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='" + mc.DatabaseName + "' AND COLUMN_NAME LIKE '%" + txtSearch.Text + "%';"; frmQueryResults qr = new frmQueryResults(mc, qry); qr.Show(); } catch (Exception) { } }