I have a windows form bound to a "products" table.
I've tried binding to a dataview and a dataviewmanager, but i can't figure out how to achieve a sort by joined table.
"products" table has a column "seasonName". this links to a "seasons" table. "seasons" table has a column called "sortOrder". I want to sort by that column first.
if I were to do it in SQL it would look like:
SELECT products.* FROM products JOIN seasons ON seasons.Name = products.seasonName ORDER BY seasons.sortOrder, products.Category, products.Name
does anybody know how to achieve this functionality in a winform binding aspect
thanks

how to sort winform's databinding by related table's column?
Salvo Dan
MyDataTable.DataView.Sort = "sortOrder, Category, Name";
Orcun Baslak
just textboxes & such bound to that "products" table.
bzurer
-Michael
williamguy
can you tell me how one creates an expression column
i guess i should ask, did you create this expression column in your database or in your .Net dataset
i'll go dig around in the docs... i have never done this before (in a DataSet I mean).
Thanks :)
Hammy20111
tried it, didn't work. exception was "Couldn't find column 'seasons.sortOrder'.
I also tried a Sort = "Relation9.sortOrder" (Relation9 being the name of the relation in the dataset joining the two tables). same error there. :(
Jerry Povse - MSFT
MyDataTable.DataView.Sort = "seasons.sortOrder, products.Category, products.Name"
would have worked but you would need to bind the controls to the DataView, not the Table.