How do i update 2 related tables at the same time?

How do i update 2 related tables at the same time?

PatricioFinkPatricioFink Posts: 27Questions: 12Answers: 0
edited February 2016 in Editor

I have an Aricle table with columns "ID" and "Name".

I have an Stock table with columns "ID" , "Article_ID" and "Quantity". Article_ID is a FK to the ID of the Article table.

In my page i want a table that is:

Article.Name | Stock.Quantity
--------------------------------------
Hat                |  4
Pant              |  2
Belt               |  9

How i can update any field in that table if the (.Net) Databales.Editor class only takes one table as argument?

And how my model has to be?

Edited by Allan - Formatting. Details on how to format text using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,864Questions: 1Answers: 10,136 Site admin
    Answer ✓

    Hi,

    The way to do this is to use the LeftJoin method which is described in detail in the manual. There is a live example of left join in action (the example on this site is PHP based, but the .NET package includes the same example for the .NET world and the related models.

    Regards,
    Allan

This discussion has been closed.