借鉴了http://stackoverflow.com/questions/4473928/c-sharp-dynamic-string-property-path public class ReflectUtil { public static object ReflectOnPath(object o, string path) { object value = o; string[] pathCompon
[原地址] for xml path作用:将多行的查询结果,根据某一些条件合并到一行. 例:现有一张表 执行下面语句 select Department, (SELECT Employee+',' FROM People b WHERE b.Department=a.Department For XML Path('')) Student from People as a group by Department 得如下结果