473,406 Members | 2,620 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,406 software developers and data experts.

Traverse the Many-to-Many relationship?

I have two tables in an Access database with a Many-to-Many relationship,
there is a connection table. The tables are [Product Line], [Factors], and
the connection table is [Product Line performance Factors] this is a standard
Many-to-Many relationship in that the connect table only has two foreign key
columns one for each of the other table primary keys, a very straightforward
setup.

The above is setup in a data set in a Data Set called “ProductDataSet” in a
C# program. I have a record (row) in the [Product Line]. See code below:
ProductDataSet.ProductLineRow productLineRow;
productLineRow =
(ProductDataSet.ProductLineRow)modelRow.GetParentR ow("Product LineModel");
The “modelRow” I from a parent table to the product table that the row was
choose through a control.

The question is how do I get the set of rows form the [Factors] table
knowing the row for the [Product Lint] table; how do I traverse the
relationship? There is a method attached to the [Product Line] table row
called:
productLineRow.GetProduct_Line_performance_Factors Rows()
I tried to use it as such:
ProductDataSet.FactorsDataTable [] factorsTable;
factorsTable =
(ProductDataSet.FactorsDataTable)productLineRow.Ge tProduct_Line_performance_FactorsRows();
However, this is not working it seams to want to return an array. An array
of what?

This is should be a straightforward operation that is easily accomplished in
SQL.
PARAMETERS ProductLineID Long;
SELECT [Product Line].[Product Line ID], Factors.[Factors Name],
Factors.[Factor Coefficent A0], Factors.[Factor Coefficent A1],
Factors.[Factor Coefficent A2]
FROM [Product Line] INNER JOIN (Factors INNER JOIN [Product Line performance
Factors] ON Factors.[Factors ID] = [Product Line performance
Factors].[Factors ID]) ON [Product Line].[Product Line ID] = [Product Line
performance Factors].[Product Line ID]
WHERE ((([Product Line].[Product Line ID])=[ProductLineID]));

I have on row in on table I should be able to easily get a table back of the
rows that it refers to. Do I have to revert to a separate quire to perform
this operation?
Thank you,

--
Mike Reed
Jul 28 '06 #1
1 2464
Michael D. Reed wrote:
I have two tables in an Access database with a Many-to-Many
relationship,
there is a connection table. The tables are [Product Line],
[Factors], and
the connection table is [Product Line performance Factors] this is a
standard Many-to-Many relationship in that the connect table only has
two foreign key
columns one for each of the other table primary keys, a very
straightforward
setup.

The above is setup in a data set in a Data Set called

Oops, time for my standard "dotnet" reply:
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended
practice) , but this is a classic ADO newsgroup. ADO.Net bears very little
resemblance to classic ADO so,
while you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.adonet.

Oh wait, this is a crosspost ... well, you've included two irrelevant
newsgroups in your crosspost list. I encountered this post in .data.ado,
which again, is a classic ADO group. The other irrelevant group is the
vb.database group, which again, has nothing to do with .Net. Best practice
is to limit your post to a single newsgroup (the csharp group was definitely
relevant, and you will probably get good help there) ... if you mistakenly
pick an irrelevant group, someone will steer you in the right direction
(politely, I hope).
rows that it refers to. Do I have to revert to a separate quire to
perform
this operation?
That would be my preferred way of doing it, but perhaps the dotnet guys can
steer you to a builtin way.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 29 '06 #2

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

Similar topics

3
by: john | last post by:
I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the user clicks on a certain button on the page, which is not in the grid, I want to be able to...
3
by: Stephen | last post by:
I have the following code that uses xquery to return search results from an xml doc. dim xmlString as string xmlString = "siteMapNode/siteMapNode/siteMapNode/siteMapNode"...
2
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the...
0
by: bhumming | last post by:
hi, i am developing a web application in ASP.NET. It should automatically traverse through each item in a dropDownList and display related data. thanks a lot,
0
by: Subba Rao via DotNetMonster.com | last post by:
---------------------------HTML---------------------------------------- <html> <head> <title>:: DHTML Table Demo ::</title> <script langauge="javascript" src="InterchangeRows.js"></script>...
5
by: Bob Day | last post by:
Using vs 2003, vb.net It is not clear from the documentation, but it appears that a raised event will traverse up the call stack upwards until it reaches its handler. Is this correct? See the...
3
by: Shaurya Vardhan | last post by:
Hi, How to Traverse all the nodes of a Tree View Control using VB.Net? Thanx in Advance.
4
by: shinya | last post by:
Hi there! I'm trying to figure out how to traverse an xml hierarchy from within javascript. Here's my text.xml file: <?xml version="1.0" encoding="ISO-8859-1"?> <main> <text1>this is a...
4
by: Gary Wessle | last post by:
hi I did not find any way to traverse a given directory in c++ till I found boost, not sure if there many boost(ers) out here. but this is given me some error I cannot locate a fix. thanks ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.