using System; using System.Collections.Generic; using System.Data; using System.Text; namespace Gzcms.Common { public class CreateTable { public static DataTable getTable() { //1.创建 datatable DataTable dt = new DataTable("datatable");//可以给表创建一…
DataTable转List,DataTable转为Model对象帮助类 public class ModelConvertHelper<T> where T : new() { public static List<T> ConvertToModel(DataTable dt) { // 定义集合 List<T> ts = new List<T>(); // 获得此模型的类型 Type type = typeof(T); string tempName =…