Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2008

Tip: Looking for answers? Try searching our database.

dataset relations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cdude - 30 May 2008 14:44 GMT
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 ) - 30 May 2008 14:54 GMT
> 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
[quoted text clipped - 6 lines]
> the product it only displays one of the linked items not all of them i
> need them all.

and your question is?
Cdude - 30 May 2008 15:03 GMT
On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.com> wrote:

> > 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
[quoted text clipped - 8 lines]
>
> and your question is?

Is that i cant display all the stock items linked to a product
Cdude - 30 May 2008 15:08 GMT
example my product code is 22

in the stocklink table is     prodcode;stockcode;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
Cdude - 30 May 2008 15:10 GMT
How do i display them all
Ignacio Machin ( .NET/ C# MVP ) - 30 May 2008 16:15 GMT
> 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?
Ignacio Machin ( .NET/ C# MVP ) - 30 May 2008 16:16 GMT
> On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"
>
[quoted text clipped - 14 lines]
>
> 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.GetChildRows()
if not you can create a dataview of the child table

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.