摘要: This code sample demonstrates how to copy class properties from one class to another even if they are not the same type. It also demonstrates how to validate a class's required properties dynamically. Both of these can increase your coding productivity especially when dealing with web service versions of your business classes. 阅读全文
posted @ 2009-01-04 20:35 灵动生活 阅读(1665) 评论(0) 推荐(0) 编辑
摘要: 基本思路 利用反射机制将DataTable的字段与自定义类型的公开属性互相赋值。注意:从DataSet到IList的转换,自定义类型的公开属性必须与DataTable中的字段名称一致,才能到达想要的结果。建议DataTable的定义从数据库来,自定义类型用O/R Mapping的方式获得。 阅读全文
posted @ 2009-01-04 13:01 灵动生活 阅读(2721) 评论(2) 推荐(0) 编辑