Example #1
0
        /// <summary>
        /// 返回查询的分布结果
        /// </summary>
        /// <param name="connectionString">连接的目标字符串</param>
        /// <param name="PageSize">分页的大小</param>
        /// <returns>查询结果</returns>
        /// <remarks>
        /// <p>GetResult在实现上,返回QueryResult中含有一个未关闭的SqlCommnad</p>
        /// <p>GetResult在执行时会先得到当前会话在数据库中的线程ID,之后以这个ID在数据库中创建全局临时表。</p>
        /// <p>查询的结果会先Into到这个临时表中,之后QueryResult的每一次更新数据都从这个临时表中提取。</p>
        /// </remarks>
        ///

        public QueryResult  GetResult(String connectionString, int PageSize)
        {
            foreach (var col in this.Ins.SelectedCols.Where(p => p.DataCol.DataType == Data.PropertyType.Enum && (p.Values == null || p.Values.Count == 0)))
            {
                col.Values = this.Facotry.GetStateValues(col.DataCol);
            }
            return(SqlScriptFac.Result(connectionString, this.Ins, PageSize));
        }
Example #2
0
 private System.Data.SqlClient.SqlCommand GetSql(String AttachSql)
 {
     foreach (var col in this.Ins.SelectedCols.Where(p => p.DataCol.DataType == Data.PropertyType.Enum && (p.Values == null && p.Values.Count == 0)))
     {
         col.Values = this.Facotry.GetStateValues(col.DataCol);
     }
     return(SqlScriptFac.GetSql(this.Ins));
 }