Datagrid and multiple tables


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Datagrid and multiple tables

  1. #1
    Dave Mohler Guest

    Datagrid and multiple tables

    Hello,

    I am frustrated trying to understand how to use the datagrid to display
    columns from multiple tables.

    I have one table which defines parts and has a PART_ID primary key column.
    The other two tables define material costs and labor costs, and they each
    have a foreign key on PARTS_ID.

    Isn't there a way to display all of the columns from all three tables in one
    datagrid? I want the user to have access to a master grid where descriptions
    (the first table), material prices and labor units can all be edit and
    updated to the respective tables.

    Thanks,
    Dave



  2. #2
    Bruce Guest

    Re: Datagrid and multiple tables


    Hi Dave,

    To display mutiple tables in a datagrid, make all the tables part of a dataset
    and set the datasource (of the datagrid) to the dataset.

    For your task, you will also have to set the relationships (in the dataset)
    of the tables.

    Bruce,


    "Dave Mohler" <dmohler@clearlogic.net> wrote:
    >Hello,
    >
    >I am frustrated trying to understand how to use the datagrid to display
    >columns from multiple tables.
    >
    >I have one table which defines parts and has a PART_ID primary key column.
    >The other two tables define material costs and labor costs, and they each
    >have a foreign key on PARTS_ID.
    >
    >Isn't there a way to display all of the columns from all three tables in

    one
    >datagrid? I want the user to have access to a master grid where descriptions
    >(the first table), material prices and labor units can all be edit and
    >updated to the respective tables.
    >
    >Thanks,
    >Dave
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center