Exemple #1
0
        private void executeQueryFromSimpleButton_Click(object sender, EventArgs e)
        {
            try
            {
                OpenLoading();
                ClearGridView(fromGridView, fromGridControl);

                ConnectionType?type         = (ConnectionType?)typeFromImageComboBoxEdit.EditValue;
                string         scriptOrPath = ObterScriptOuPathPorTipo(type);

                if (!AllowsToConsult(type, scriptOrPath))
                {
                    return;
                }

                DataTable table = appService.GetByType(type.Value, scriptOrPath);
                fromGridControl.DataSource = table;
                CreateSummaryGridView(fromGridView, fromGridControl);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                CloseLoadind();
            }
        }
Exemple #2
0
        private void LoadTableByType(ConnectionType type)
        {
            if (appService == null)
            {
                ConfigureServices();
            }

            switch (type)
            {
            case ConnectionType.SqlServer:
                tablesGridControl.DataSource = appService.GetByType(ConnectionType.SqlServer, "SELECT name AS TABELA FROM SYS.tables ORDER BY name ASC");
                tablesGridControl.RefreshDataSource();
                break;

            case ConnectionType.Odbc:
                tablesGridControl.DataSource = appService.GetByType(ConnectionType.Odbc, "SELECT CONVERT(VARCHAR(500),O.NAME) AS TABELA FROM SYSOBJECTS O WHERE TYPE = 'U' ORDER BY O.NAME");
                tablesGridControl.RefreshDataSource();
                break;

            case ConnectionType.Firebird:
                tablesGridControl.DataSource = appService.GetByType(ConnectionType.Firebird, "SELECT a.RDB$RELATION_NAME TABELA FROM RDB$RELATIONS a");
                tablesGridControl.RefreshDataSource();
                break;

            default:
                tablesGridControl.DataSource = null;
                tablesGridControl.RefreshDataSource();
                break;
            }
        }