EnumerableRowCollection<PlatformLogPO> source =
from log in dataTable.AsEnumerable()
select new PlatformLogPO
{
PlatformId = (log["platformId"] == DBNull.Value) ? 0L : ((long)log["platformId"]),
RequestInfo = (log["requestInfo"] == DBNull.Value) ? string.Empty : ((string)log["requestInfo"]),
SalesType = (log["salestype"] == DBNull.Value) ? 0 : ((byte)log["salestype"])
};
在最后
SalesType = (log["salestype"] == DBNull.Value) ? 0 : ((byte)log["salestype"]) 将String 转成Byte 时出了问题