private void btEjecutar_Click(object sender, EventArgs e) { try { gvSQLResult.DataSource = sqlServer.EjecutarConsulta(tbSQLCommand.Text).Tables[0].DefaultView; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btConnectDB_Click(object sender, EventArgs e) { AccessDB accessDB = new AccessDB(); accessDB.ShowDialog(); if (AccessDB.isReady) { lbConnection.Text = AccessDB.lbConnection; sqlServer = new DBSQLServer(lbConnection.Text); gvTables.DataSource = sqlServer.EjecutarConsulta("Select name as Tables From sysobjects Where type = 'U'").Tables[0].DefaultView; } }