日期:2014-05-17  浏览次数:20467 次

dataReader 获取为null
本帖最后由 u013776377 于 2014-03-05 19:45:45 编辑
这哪有问题呢  调半天看不出来  不进 while(reader.read()){}


    public class Provider:IProvider
    {
        private string connectionString;
        public string ConnectionString {
            get {
                return connectionString;
            }
        }
        public Provider() {
            connectionString = ConfigurationManager.AppSettings.Get("ConStr");
        }
        public List<User> getlist(User user,int rp,int page,ref int count)
        { 
            
                string sql = string.Empty;
                sql += "select TOP (@pagesize) * from [tb_User]";
                sql += " where UserID>isnull((";
                sql += "select MAX(UserID) from (";
                sql += "select TOP (@pagesize*(@page-1)) UserID from [tb_User] ORDER BY UserID ASC)n),0)";
                sql += " and RealName like '%@RealName%'";
                sql += " ORDER BY UserID ASC";
                SqlParameter[] paras = { 
                                       new SqlParameter("@pagesize",rp),
                                       new SqlParameter("@page",page),
                                       new SqlParameter("@RealName",user.RealName)};
                List<User> list = new List<User>();
               &nbs