本帖最后由 yuemb369 于 2011-07-21 17:24:04 编辑

解决方案 »

  1.   


    //以下代码  测试通过
    void Main()
    {
    var list=new List<User>{
     new User{ userID=1, userName="u1"},
     new User{ userID=2, userName="u2"},
     new User{ userID=3, userName="u3"},
    };
    PropertyInfo[] _properties = typeof(User).GetProperties();var result = list.Select(value => _properties.Select (prop => (prop.GetValue(value, new object[0]) ?? string.Empty).ToString()) .ToList()).ToList();
     
     
     
    }
    public class User
    {
      public int userID{get;set;}
      public string userName{get;set;}
    }
      

  2.   

    IQueryable<User> queriable = (.....).ToList(); //数据从库中取出来后 加载到存中先
      

  3.   

    很对,很强大,原来缺了个ToList()