【发布时间】:2014-03-03 21:35:15
【问题描述】:
我需要动态获取属性及其值。我下面的代码失败了。有人可以帮帮我吗?我已经尝试了很多例子,但到目前为止还没有。
Dim seriesName As String = s.SeriesName
If model.Settings.ShowNativeLanguage Then
Dim propInfo As System.Reflection.PropertyInfo = s.GetType().GetProperty(model.Country)
seriesName = CStr(propInfo.GetValue(s, Nothing))
End If
此代码产生错误“对象与目标类型不匹配”。
【问题讨论】:
标签: vb.net linq entity-framework