You could use a DataRelation object.
Pseudo Code:
- create dataset
- read table albums
- read table tracks
- create DataRelation object for tracks <--> albums
alternatively, (and quicker)
is to create a stored procedure and run it from the data
adapter instead of a query:
CREATE PROCEDURE [dbo].[GetAlbums]
AS
BEGIN
Select Tracks.* from Tracks T inner join Albums A ON
T.AlbumID = A.AlbumID
END
The second method should work in any standard T-SQL
enabled db such as MySQL, INTERBASE, MS-SQL or Access.
You would need to check specific formatting, especially
for Access and INTERBASE.
Hope this helps.
-----Original Message-----
Hello,
I have a dataset with 2 tables. I want to display only
selected datafrom one of these tables.
The table names are Albums and Tracks. That Dataset is
calledAlbumsTracks
If I only wanted to select those tracks that had a
common AlbumID asthose in Albums - how would I get this out of a dataset?
Pseudo code:
Select * from Tracks where AlbumID=Albums.AlbumID
from Dataset Albums tracks.
Syntax? Or is there a smarter method?
Thanks,
Tmuld.
.