C#对象、List<>转DataTable
2021-01-20 04:12
标签:bsp datarow eric next table ati type object ict public static DataTable ObjectToTable(object obj) 标签:bsp datarow eric next table ati type object ict 原文地址:https://www.cnblogs.com/pzxnet/p/12148753.html
{
try {
Type t;
if (obj.GetType().IsGenericType)
{
t = obj.GetType().GetGenericTypeDefinition();
}
else
{
t = obj.GetType();
}
if(t== typeof(List)||
t==typeof(IEnumerable))
{
DataTable dt = new DataTable();
IEnumerable