Fixed Price Projects          Flexibele IT oplossingen

Software op maat              Web Applications

  For Each p As System.Reflection.PropertyInfo In Me.GetType.GetProperties()

            If p.DeclaringType.Name.Equals("clsBaseClass"Then

                'declared here, do not try to get value from datarow (internal property) (eg. Original)

            ElseIf p.PropertyType.BaseType Is GetType(clsBaseClassThen

                'this property is also a class

                Dim subcls As Object = Activator.CreateInstance(p.PropertyType)

                DirectCast(subcls, clsBaseClass).fill_me_with_datarow(row)

                p.SetValue(Me, subcls)

            Else

                'found the property in the datarow, copy the value to the property

                If row.Table.Columns.Contains(p.Name) Then

                    p.SetValue(Me, getNullableFieldValue(p, row(p.Name)))

                Else

                    Dim i As Integer = 0

                End If

            End If

        Next

Categorie: .NET
Actions: E-mail | Permalink |

waardering