Re: DataView on two DataTables

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

"Garik" <garik_ma@do not spam.yahoo.com> wrote in message
news:B23EFE4A-CED8-4753-90EF-5DF6D7299761@xxxxxxxxxxxxxxxx
Thank you Bart Mermuys,

It is the exact solution I was looking for.

I tried using Expression Columns, but I don't realize when the expression
is
evaluated?

Is the value in the column will be changed, if I modify the row in
the Parent (Customer) table? Is the value in the column will be changed,
if I
modify Foreign Key column in the Child table (OrderHeader)?

It looks like the expression is evaluated when either of the two changes you
mention happen.


If expression is evaluated every time when I query the value in the
column,
the performance will be very slow in my view.

I believe the expression is _not_ evaluated each time you access the value,
if that's what you mean.

HTH,
Greetings


--
Regards,
Garik Melkonyan
MCP, MCAD, MCSD .NET


"Bart Mermuys" wrote:

Hi,

"Garik" <garik_ma@do not spam.yahoo.com> wrote in message
news:4F794C82-B126-49C2-98EC-D07E64F9F742@xxxxxxxxxxxxxxxx
For example I have two tables: Order Header and Customer, and a
relation
OrderHeader.CustKey = Customer.CustKey.

Suppose you want to show OrderHeader fields but also
OrderHeader.Customer.Name, then you could "import" the Customer.Name into
the OrderHeader table (if you have the right relation), eg.:

OrderHeader table:
- Add column:
- Name : "CustomerName"
- Expression : "parent(fk_customer_orderheader).Name"

Once you have that, you should be able to filter and sort using the
BindingSource.

HTH,
Greetings


So, I want to show Orders in the DataGridView, and Filter or Sort that
grid
by 'Customer.CustomerName, Order.OrderDate DESC'.

Thanks.

"Cor Ligthert [MVP]" wrote:


If not, how can I implement this for sorting, filtering?????

That is completely dependend from what you want, however as Frans
said, a
dataview is only doing one table, therefore tell what you want, and
what
is
the data in your rows (and what are the relations)

Cor








.



Relevant Pages

  • Re: Filter: Multiple values in a cell
    ... columns as you need and then sort and/or filter based on that new column. ... > features by the customer name. ... one feature can be requested by multiple customers. ...
    (microsoft.public.excel.misc)
  • Re: DataView on two DataTables
    ... modify Foreign Key column in the Child table? ... Suppose you want to show OrderHeader fields but also ... you should be able to filter and sort using the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataView on two DataTables
    ... Suppose you want to show OrderHeader fields but also ... you should be able to filter and sort using the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: max of sum
    ... "order by 2 desc" means sort the output of the 2nd column in the SELECT ... See the Access Help article on the TOP predicate for more info. ... > i need to filter out the customer who bought most tickets in an access db. ...
    (microsoft.public.access.queries)