Exemplo n.º 1
0
        /// <summary>
        /// 由表得到集合
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dt"></param>
        /// <returns></returns>
        public List <T> FillCollection <T>(DataTable dt) where T : new()
        {
            List <T> list = new List <T>();

            list = TableList <T> .TableToList(dt, false);

            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// sql语句得到集合
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="cmd"></param>
        /// <returns></returns>
        public List <T> FillCollection <T>(string cmd) where T : new()
        {
            List <T> list = new List <T>();
            DataSet  ds   = this.Getds(cmd, "temp");

            list = TableList <T> .TableToList(ds.Tables["temp"], false);

            return(list);
        }