Example #1
0
        /// <summary>
        /// 摘要:根据条件查询数据集记录条数
        /// </summary>
        /// <param name="dataSetSql">查询语句(包括列名、表等信息,支持表关联)</param>
        /// <param name="where">条件组,二维数据【0】为包括字段名的语句段模板,【1】为取值</param>
        /// <returns></returns>
        public int GetDataSetCount(string dataSetSql, List <string[]> where)
        {
            int    iCount      = -1;
            string stTableName = string.Empty;

            try
            {
                T obj = (T)this.MemberwiseClone();
                stTableName = ((TableAttribute)obj.GetType().GetCustomAttributes(true)[0]).TableName;
                IDBCore iDB = DBFactory.CreateDB();

                /*if (DATABASE_TYPE == "XML")
                 * {
                 *  iDB = new XMLCore(_TagData);
                 * }
                 * else
                 * {
                 *  iDB = DBFactory.CreateDB();
                 * }*/
                iCount = iDB.GetDataSetCount(dataSetSql, where);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(iCount);
        }