How to use the Datagrid with multiple tables.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cr113@hotmail.com

    #1

    How to use the Datagrid with multiple tables.


    Suppose you have the following 2 database tables:


    Table1 - primary key = Field1
    Field1 Field2
    a 1
    b 2
    c 2


    Table2 - primary key = Field2
    Field2 Field3
    1 Y
    2 Z


    I can display this in a datagrid:


    Field1 Field2 Field3
    a 1 Y
    b 2 Z
    c 2 Z


    How do I update the underlying database tables? It's easy with one
    table but I can't find any documentation on how to do it with multiple
    tables.

  • vMike

    #2
    Re: How to use the Datagrid with multiple tables.


    <cr113@hotmail. com> wrote in message
    news:1102690083 .461991.103470@ c13g2000cwb.goo glegroups.com.. .[color=blue]
    >
    > Suppose you have the following 2 database tables:
    >
    >
    > Table1 - primary key = Field1
    > Field1 Field2
    > a 1
    > b 2
    > c 2
    >
    >
    > Table2 - primary key = Field2
    > Field2 Field3
    > 1 Y
    > 2 Z
    >
    >
    > I can display this in a datagrid:
    >
    >
    > Field1 Field2 Field3
    > a 1 Y
    > b 2 Z
    > c 2 Z
    >
    >
    > How do I update the underlying database tables? It's easy with one
    > table but I can't find any documentation on how to do it with multiple
    > tables.
    >[/color]

    Take a look at dataset merge. The two table must have the same primary key,
    so you will have to use field 2 as the primary key. You can use the missing
    schema action to add the field3 column.


    Comment

    Working...