///DataTable到范型转换
/// <summary>
/// 适合于实体类和DataTable对应的情况
/// </summary>
//将泛型类转换成DataTable
public static DataTable ToDataTable<T>(List<T> entitys)
{ DataTable dtResult = new DataTable();
if (entitys == null || entitys.Count < 1)
{
throw new Exception("需转换的集合为空");
}
Type entityType = entitys[0].GetType();
List<PropertyInfo> propertyInfoList = entityType.GetProperties().ToList<PropertyInfo>;...