当 PropertyInfo.SetValue() 遇到“Object of type 'System.Int32' cannot be converted to type 'System.UInt32'.”

判断一下类型:

if (p.PropertyType == typeof(uint))
{
    p.SetValue(t, Convert.ToUInt32(row[p.Name]), null);
}
else
{
    p.SetValue(t, row[p.Name], null);
}


xoyozo 8 个月前
转载请注明出处
云服务器 精选特惠
可能相关的内容