I meant making SQL requests against tables in the database using appropriate
DB access components, like DataAdapter, DbCommand (Ole or Sql) for
populating the dataset.
As I see now, you mean something else. You already have your dataset with 3
tables inside and you want to run your requests against the tables in the
dataset as opposed to the ones in the database. If you insist on this model,
I can't help you much, I don't have any practical experience in selecting
required data from the related tables in the dataset. But, it looks to me,
you could charge your database with running selects, with sql it's easy and
straightforward. Just one data access operation with the select will
replaces many lines on code you might have to write otherwise. Also, you
wouldn't need your DataRelation object.
OK, I understand that you might still have good reasons to follow your way.
Eliyahu
"niv" <ni*@hotmail.com> wrote in message
news:00****************************@phx.gbl...
I have to do it this way because I am working with 3
DataTables.
What do you mean by use a SQL statement?
how? When retrieving the DataSet?
Thanks,
niv-----Original Message-----
I am not sure what you mean by "traversing through the
set relationships toretrieve data". Why can't you use just a SQL select
statement?
SELECT t2.TableTwoDesc
FROM TableOne t1 INNER JOIN
TableOne_TableTwo_Relationship t12ON t1.TableOneID = t12.TableOneID
INNER JOIN TableTwo t2
ON t12.TableTwoID = t2.TableTwoID
WHERE t1.TableOneID = myID
Eliyahu
"niv" <ni*@hotmail.com> wrote in message
news:0d****************************@phx.gbl... Hi,
I am unsure on how to retrieve data from tables 2 tables
that are related through a relationship table..
TableOne
--------
TableOneID
TableOneDesc
TableTwo
--------
TableTwoID
TableTwoDesc
TableOne_TableTwo_Relationship
------------------------------
TableOne_TableTwo_RelID
TableOneID
TableTwoID
I have related TableOne to TableOne_TableTwo_Relationship. Then I have related TableTwo to
TableOne_TableTwo_Relationship.
I am unsure on how to traverse though the set
relationships to retrieve data. ie) I want to print out
all TableTwoDesc that have been related to a specific
TableOneID.
Thanks for your help,
niv
.