示例#1
0
        private void btnValidateSql_Click(object sender, EventArgs e)
        {
            List <ParseErrorInfo> errors;

            ContextMenu contextMenu;

            DataViewDB dvDB;

            SqlParser.Instance().Parse(this.textEditorControl.Document.TextContent, 0, out dvDB, out errors, out contextMenu);

            this.textEditorControl_Output.Document.HighlightingStrategy =
                HighlightingStrategyFactory.CreateHighlightingStrategy("TSQL");

            textEditorControl_Output.Document.TextContent = null;

            if (dvDB != null)
            {
                OnError(dvDB.Errors);

                dvDB.InitOption();

                dvDB.Context.Wise(null);
                var builder = new StringBuilder();
                dvDB.Context.Render(builder);
                this.textEditorControl_Output.Text = builder.ToString();
                this.textEditorControl_Output.Invalidate();
                textEditorControl_Output.Refresh();
            }
        }