/// <summary>
        /// Executes the query.
        /// </summary>
        /// <param name="select">The select.</param>
        /// <returns>DataSet.</returns>
        public override DataSet ExecuteQuery(string select)
        {
            DataSet dataSet = null;

            using (var cn = new DqlConnection(ConnectionString))
            {
                cn.Open();
                using (DqlCommand cmd = new DqlCommand(select, cn))
                {
                    using (DqlDataAdapter adapter = new DqlDataAdapter(cmd))
                    {
                        dataSet = new DataSet();
                        adapter.Fill(dataSet);
                    }
                }
            }
            return(dataSet);
        }
        public void Test_DqlFill()
        {
            string  select  = "Select r_object_id, keywords from dm_cabinet enable(return_top 1); select * from dm_document enable(return_top 1)";
            DataSet dataset = new DataSet();
            string  cnstr   = "User=dmadmin;Password=@vmware99;Repository=ls_repos";

            using (DqlConnection cn = new DqlConnection(cnstr))
            {
                cn.Open();
                using (DqlCommand cmd = new DqlCommand(select, cn))
                {
                    using (DqlDataAdapter adapter = new DqlDataAdapter(cmd))
                    {
                        var schemas = adapter.Fill(dataset);
                        Assert.AreEqual(dataset.Tables.Count, 2);
                        Assert.AreEqual(dataset.Tables[0].Rows.Count, 1);
                        Assert.AreEqual(dataset.Tables[1].Rows.Count, 1);
                    }
                }
            }
        }
        public void Test_DqlMultiQuery()
        {
            DataSet dataset = new DataSet("MulitQueryTest");
            string  cnstr   = "User=dmadmin;Password=@vmware99;Repository=ls_repos";

            using (DqlConnection cn = new DqlConnection(cnstr))
            {
                cn.Open();
                using (DqlCommand cmd = new DqlCommand(File.ReadAllText(".\\DqlMultiQueryTest.txt"), cn))
                {
                    using (DqlDataAdapter adapter = new DqlDataAdapter(cmd))
                    {
                        var schemas = adapter.Fill(dataset);
                        var table   = dataset.MergeAll();
                        Assert.AreEqual(dataset.Tables.Count, 21);
                        Assert.AreEqual(table.Rows.Count, 10000);
                        //Assert.AreEqual(dataset.Tables[0].Rows.Count, 1);
                        //Assert.AreEqual(dataset.Tables[1].Rows.Count, 1);
                    }
                }
            }
        }
        /// <summary>
        /// Executes the query.
        /// </summary>
        /// <param name="select">The select.</param>
        /// <param name="token">The token.</param>
        /// <returns>DataSet.</returns>
        public override DataSet ExecuteQuery(string select, CancellationToken token)
        {
            if (UseExternalQueryEngine())
            {
                return(ExecuteQueryExternal(select));
            }

            DataSet dataSet = null;

            using (var cn = new DqlConnection(ConnectionString))
            {
                cn.Open();
                using (DqlCommand cmd = new DqlCommand(select, cn))
                {
                    using (DqlDataAdapter adapter = new DqlDataAdapter(cmd))
                    {
                        dataSet = new DataSet();
                        adapter.Fill(dataSet, token);
                    }
                }
            }
            return(dataSet);
        }