dataset relations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cdude

    dataset relations

    I have three datatables in my dataset firstly a products then a
    stocklink then a stock table. Now i have linked products table to a
    datagrid and the stock. The stock link table joins these 2 tables
    together i have a relationship between products and stocklink and i
    have a relationship between stocklink and stock. Now when i change the
    selection of the product i want all the stockitems linked to that
    product to display in the grid linked to stock datatable. One product
    might be linked to many stock items. At the moment whenever i change
    the product it only displays one of the linked items not all of them i
    need them all.
  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: dataset relations

    On May 30, 9:44 am, Cdude <camelj...@yaho o.comwrote:
    I have three datatables in my dataset firstly a products then a
    stocklink then a stock table. Now i have linked products table to a
    datagrid and the stock. The stock link table joins these 2 tables
    together i have a relationship between products and stocklink and i
    have a relationship between stocklink and stock. Now when i change the
    selection of the product i want all the stockitems linked to that
    product to display in the grid linked to stock datatable. One product
    might be linked to many stock items. At the moment whenever i change
    the product it only displays one of the linked items not all of them i
    need them all.
    and your question is?

    Comment

    • Cdude

      #3
      Re: dataset relations

      On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"
      <ignacio.mac... @gmail.comwrote :
      On May 30, 9:44 am, Cdude <camelj...@yaho o.comwrote:
      >
      I have three datatables in my dataset firstly a products then a
      stocklink then a stock table. Now i have linked products table to a
      datagrid and the stock. The stock link table joins these 2 tables
      together i have a relationship between products and stocklink and i
      have a relationship between stocklink and stock. Now when i change the
      selection of the product i want all the stockitems linked to that
      product to display in the grid linked to stock datatable. One product
      might be linked to many stock items. At the moment whenever i change
      the product it only displays one of the linked items not all of them i
      need them all.
      >
      and your question is?
      Is that i cant display all the stock items linked to a product

      Comment

      • Cdude

        #4
        Re: dataset relations

        example my product code is 22

        in the stocklink table is prodcode;stockc ode;qty
        22 8888 1
        22 9999 2

        in the stock table code; desc ;qty
        8888 item1 12
        9999 item2 10

        now when i select product with code 22 i want to display item1 and
        item2 in a grid

        Comment

        • Cdude

          #5
          Re: dataset relations

          How do i display them all

          Comment

          • Ignacio Machin ( .NET/ C# MVP )

            #6
            Re: dataset relations

            On May 30, 10:10 am, Cdude <camelj...@yaho o.comwrote:
            How do i display them all
            display them where?

            You can use several controls for it, like a grid, a tree, etc

            also is this a web or a win app?

            Comment

            • Ignacio Machin ( .NET/ C# MVP )

              #7
              Re: dataset relations

              On May 30, 10:03 am, Cdude <camelj...@yaho o.comwrote:
              On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"
              >
              <ignacio.mac... @gmail.comwrote :
              On May 30, 9:44 am, Cdude <camelj...@yaho o.comwrote:
              >
              I have three datatables in my dataset firstly a products then a
              stocklink then a stock table. Now i have linked products table to a
              datagrid and the stock. The stock link table joins these 2 tables
              together i have a relationship between products and stocklink and i
              have a relationship between stocklink and stock. Now when i change the
              selection of the product i want all the stockitems linked to that
              product to display in the grid linked to stock datatable. One product
              might be linked to many stock items. At the moment whenever i change
              the product it only displays one of the linked items not all of them i
              need them all.
              >
              and your question is?
              >
              Is that i cant display all the stock items linked to a product
              very easy, if you have a FK relationship you can use
              DataRow.GetChil dRows()
              if not you can create a dataview of the child table

              Comment

              Working...