DataColumn Expression

S

Sébastien

Hi,

I have a DataSet with some DataTables. I would like to set the
Expression column of on DataTable to the value of another column in anothe
DataTable. Is there any way to do it ?

Example :
I have 3 tables : Bird, Dog, Cat

I create a column called Bird_Name in Cat table.
Then I want to do somethinf like :
DataSet.Table("Cat").Column("Bird_Name").Expression = "Bird.Name"

Thank you for your help.
 
W

William Ryan [eMVP]

Sebastien:

The expression column works essentially the same way here as it does in full
SQL. So you may want SELCT LastName + ", " + Firstname AS 'Full Name' From
Whatever A Valid Expression would look like Column.Expression = "CATPrice *
CatQuantity"

So in order to do anything you'd need something like CatName Like
'*SomeCatName'

Are you sure an expression is the right tool here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top