예제 #1
0
        /// <summary>
        /// Unit testing routine.
        /// </summary>
        /// <param name="queryText"></param>
        /// <returns>String value.</returns>
        public static string RunQueryBuilderTest(string queryText)
        {
            string           modifiedQueryText = queryText;
            QueryBuilderForm qbf = new QueryBuilderForm();

            qbf.QueryText = queryText;
            qbf.InitForTest();
            DialogResult res = qbf.ShowDialog();

            if (res == DialogResult.OK)
            {
                modifiedQueryText = qbf.QueryText;
            }
            qbf = null;
            return(modifiedQueryText);
        }
예제 #2
0
        /// <summary>
        /// Displays an instance of QueryBuilderForm.
        /// </summary>
        /// <param name="queryText">(optional)SQL query text from calling application. Leave blank if defining a query from scratch..</param>
        /// <returns>SQL query text defined through the query builder form.</returns>
        public string ShowQueryBuilder(string queryText)
        {
            string           modifiedQueryText = queryText;
            QueryBuilderForm qbf = new QueryBuilderForm();

            qbf.QueryText        = queryText;
            qbf.ConnectionString = this.ConnectionString;
            qbf.DatabasePlatform = this.DatabasePlatform;
            qbf.AnsiSQLVersion   = this.AnsiSQLVersion;
            qbf.InitQueryBuilder();

            DialogResult res = qbf.ShowDialog();

            if (res == DialogResult.OK)
            {
                modifiedQueryText = qbf.QueryText;
            }
            qbf = null;



            return(modifiedQueryText);
        }