473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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.
Jun 27 '08 #1
6 2208
On May 30, 9:44*am, Cdude <camelj...@yahoo.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?
Jun 27 '08 #2
On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
On May 30, 9:44 am, Cdude <camelj...@yahoo.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
Jun 27 '08 #3
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
Jun 27 '08 #4
How do i display them all
Jun 27 '08 #5
On May 30, 10:10*am, Cdude <camelj...@yahoo.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?
Jun 27 '08 #6
On May 30, 10:03*am, Cdude <camelj...@yahoo.comwrote:
On May 30, 3:54 pm, "Ignacio Machin ( .NET/ C# MVP )"

<ignacio.mac...@gmail.comwrote:
On May 30, 9:44 am, Cdude <camelj...@yahoo.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.GetChildRows()
if not you can create a dataview of the child table
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jade | last post by:
Hi, I am trying to create a dataset with 6 tables and 5 relationships created between them. I am creating it in the Form_Load event. However i keep getting the following error... An unhandled...
1
by: Horatiu Ripa | last post by:
Once defined in SQL a database, with keys, indexes and relations between tables is it possible to create a DataSet to reflect all that? Basically I don't want to reestablish the relations, to set...
1
by: Fleckman | last post by:
I have a DataSet with 14 DataTables and 18 Relationships that were defined within Visual Studio .NET 2003. Everything looks OK in the visual development environment, i.e. when I preview the DataSet...
0
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions",...
1
by: DaveF | last post by:
How can I retrieve display_names Dim custDS As DataSet = New DataSet Dim mySQL, mySQL2, mySQL3 As String
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
2
by: Joe | last post by:
Hi I have a dataset with 3 tables and 2 relations Is there a way to when I am at 1 row to tell if there is a relation on that row ??? I have the code hardcoded but try to make it work if the #...
2
by: Joe | last post by:
Hi I am going to receive a dataset downstream and I will not know the the fields number of field relations number of relations So I have to be flexible to take unknown data and be able to...
2
by: randy1200 | last post by:
My hope is that somebody has a thought on this, or can point to toward an article that's useful. I have the following: DataSet ds = new DataSet(); ds.ReadXml("MyData.xml"); Each MainTable...
0
by: kevlar | last post by:
I am having some problems reading xml into a dataset and having it set up the datatables within it properly. i serialize an object into xml and read that xml into the dataset and the code i am...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.