meaning of this line of code

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I've inherited this code and it has a function below. I've been readying about childrows but my light bulb is still not bright. Anyone can explain what that line is doing ..

Code:
 Public Function GetPricings() As Pricing()
            Return CType(Me.GetChildRows(Me.Table.ChildRelations("contract_line_item_pricing")),Pricing())
        End Function
 
I assume the Me in this case is relating to datarow or similar object.

To my understanding it seems to be doing the following:

Me.GetChildRows(Me.Table.ChildRelations("contract_line_item_pricing"))

the GetChildRows returns an array of datarows based on the specified relation, the Me.Table.ChildRelations selects the relation between the table the datarow (Me) is from, and the table linked by the relationship. The relationship "contract_line_item_pricing" may be defined in your source data (XML/DB ?) or built when loading into a dataset.

The Ctype call will then attempt to convert this array into an array of Pricing objects.

Beyond that I couldn't say what it is meant to do or why that might be the case.
 
Back
Top