private void TabControlMain_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // Execute a query on switching to the Data tab
            if (SqlContext == null ||
                (SqlContext.SyntaxProvider == null || !TabItemData.IsSelected))
            {
                return;
            }

            BoxSqlTransformer.Text = BoxSql.Text;

            if (!TabItemData.IsSelected)
            {
                return;
            }

            DataViewerResult.FillData(CBuilder.SQL);
        }
        private void QueryTransformer_SQLUpdated(object sender, EventArgs e)
        {
            // Handle the event raised by Query Transformer object that the text of SQL query is changed
            // update the text box
            try
            {
                if (DataViewerResult.QueryTransformer == null || !TabItemData.IsSelected ||
                    BoxSqlTransformer.Text == DataViewerResult.QueryTransformer.SQL)
                {
                    return;
                }

                BoxSqlTransformer.Text = DataViewerResult.QueryTransformer.SQL;

                DataViewerResult.FillData(DataViewerResult.QueryTransformer.SQL);
            }
            catch (Exception ex)
            {
                //ignore
            }
        }