Sorry, I didn't give any examples of what worked and didn't work:

Doesn't Works:
invoiceItemTable.Columns.Add("Price", typeof(float), "Child.Price");

Works:
invoiceItemTable.Columns.Add("Price", typeof(float),
"Avg(Child.Price)");

This works because it is a one-to-one relationship and it is a number.
I haven't found any hacks to make it work for strings.   What I want is:

invoiceItemTable.Columns.Add("Desc", typeof(string),
"Child.Description");

Any ideas?

Thanks,

Shawn Wildermuth
[EMAIL PROTECTED]

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]
> On Behalf Of Shawn Wildermuth
> Sent: Monday, April 22, 2002 1:37 AM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] DataColumn.Expression Syntax and Child.XXX
>
>
> Has anyone had any luck with a way to reference a child
> element in an DataColumn.Expression that doesn't involve
> aggregation?  For example:
>
> I have a table (InvoiceItems) and a another table (Products)
> that it is related to.  I want to create a column that
> references the child (through the DataRelation) field, not an
> aggregate of that field.  The relationship between
> InvoiceItems and Products is one-to-one so this isn't an
> issue, except the Expressions Syntax chokes on it unless it
> is using an aggregate.  Any ideas?
>
> Thanks,
>
> Shawn Wildermuth
> [EMAIL PROTECTED]
> http://adoguy.com
> http://shawnwildermuth.com
>
> "...for the programmer, as for the chef, the urgency of the
> patron may govern the scheduled completion of the task, but
> it cannot govern the actual completion. An omelette, promised
> in two minutes, may appear to be progressing nicely. But when
> it has not set in two minutes, the customer has two
> choices--wait or eat it raw. Software customers have had the
> same choices. The cook has another choice; he can turn up the
> heat. The result is often an omelette nothing can
> save--burned in one part, raw in another.... " - Brooks, The
> Mythical Man-Month.
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or subscribe to other DevelopMentor lists at
> http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to