Beispiel #1
0
        private IQueryBuilder BuildSQL()
        {
            teSQL.Clear();
            try {
                SqlQueryBuilder builder = new SqlQueryBuilder(_query);
                builder.Formats.SetDefaultFormats(FormatType.MsSqlServer);

                if (builder.CanBuild)
                {
                    builder.BuildSQL();
                    string sql = builder.Result.SQL;
                    teSQL.Text = sql;

                    return(builder);
                }

                return(null);
            }
            catch (Exception ex) {
                //Simply ignore any possible exception
                MessageBox.Show(ex.Message);
            }

            return(null);
        }
    protected void UpdateSql()
    {
        try {
            SqlQueryBuilder builder = new SqlQueryBuilder(query);
            builder.BuildSQL();
            SqlTextBox.Text = builder.Result.SQL;
            QueryTextFormats formats = new QueryTextFormats();
            formats.UseHtml = true;
            formats.UseMathSymbolsForOperators = true;
            literalQueryText.Text = query.GetConditionsText(formats);

            ResultGrid.Visible = false;
        }
        catch {
            SqlTextBox.Text       = "";
            literalQueryText.Text = "";
        }
    }
Beispiel #3
0
        void SetSql()
        {
            SqlQueryBuilder builder = new SqlQueryBuilder((DbQuery)queryPanel.Query);

            builder.Formats.SetDefaultFormats(FormatType.MsSqlServer);
            builder.Formats.OrderByStyle   = OrderByStyles.Aliases;
            builder.Formats.DateFormat     = "MM/dd/yyyy";
            builder.Formats.DateTimeFormat = "MM/dd/yyyy HH:mm";

            if (!builder.CanBuild)
            {
                return;
            }
            builder.BuildSQL();
            string sql = builder.Result.SQL;

            textBoxSql.Text         = sql;
            buttonExecute.IsEnabled = !string.IsNullOrEmpty(sql);
        }
Beispiel #4
0
    protected void UpdateSql()
    {
        try {
            SqlQueryBuilder builder = new SqlQueryBuilder(query);
            builder.BuildSQL();
            SqlTextBox.Text = builder.Result.SQL;
            QueryTextFormats formats = new QueryTextFormats();
            formats.UseHtml = true;
            formats.UseMathSymbolsForOperators = true;

            ResultGrid.Visible = false;

        }
        catch {
            SqlTextBox.Text = "";
           }
    }