|
|
|
Click here to copy the following block |
Function GetField(ByVal obj As Object, ByVal fieldName As String, _ ByVal defaultValue As Object) As Object Try Dim fi As FieldInfo = obj.GetType().GetField(fieldName, _ BindingFlags.Instance Or BindingFlags.Public Or _ BindingFlags.NonPublic) If Not fi Is Nothing Then Return fi.GetValue(obj) End If Dim pi As PropertyInfo = obj.GetType().GetProperty(fieldName, _ BindingFlags.Instance Or BindingFlags.Public Or _ BindingFlags.NonPublic) If Not pi Is Nothing Then Return pi.GetValue(obj, Nothing) End If Catch End Try
Return defaultValue End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|