Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ..

 

Public Function GetPricings() As Pricing()
           Return CType(Me.GetChildRows(Me.Table.ChildRelations("contract_line_item_pricing")),Pricing())
       End Function

Posted

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.

Afraits

"The avalanche has started, it is too late for the pebbles to vote"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...