|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How select from 2 ADO.NET DataTables?ADO.NET DataSet (dstPublish). tblAuthor has DataColumns AuthorID and AuthorName, tblBook has DataColumns BookID, BookTitle, AuthorID (assume a book can be written by only one author). tblAuthor --------- 1 Ayn 2 Jim 3 Sue tblBook ------- 10 Fountainhead 1 11 Atlas Shrugged 1 12 Moby Dick 2 I want to create a list of all books with their associated author name. FountainHead Ayn Atlas Shrugged Ayn Moby Dick This is a breeze in SQL for me, but I'm not sure how to go about using ADO.NET DataTables. Do I need a DataRelation, or is it just a matter of having a for loop within a for loop, or is it something else? Thanks, Ron Ronald,
If there is a relation set, than you can use the childrows from the tblAuthor If there is no relation set, than you can set the AuthorID as a rowfilter in the tblBook.defaultview (an inbuild dataview) As well you can use the TableSelect with an expression. The less work is that dataview method. I hope this helps, Cor Show quoteHide quote "Ronald S. Cook" <rc***@westinis.com> schreef in bericht news:ei5zPPARGHA.2436@TK2MSFTNGP11.phx.gbl... > Let's say I have 2 ADO.NET DataTables (tblAuthor and tblBook) within an > ADO.NET DataSet (dstPublish). > > > > tblAuthor has DataColumns AuthorID and AuthorName, tblBook has > DataColumns BookID, BookTitle, AuthorID (assume a book can be written by > only one author). > > > > tblAuthor > > --------- > > 1 Ayn > > 2 Jim > > 3 Sue > > > > tblBook > > ------- > > 10 Fountainhead 1 > > 11 Atlas Shrugged 1 > > 12 Moby Dick 2 > > > > I want to create a list of all books with their associated author name. > > > > FountainHead Ayn > > Atlas Shrugged Ayn > > Moby Dick > > > > This is a breeze in SQL for me, but I'm not sure how to go about using > ADO.NET DataTables. Do I need a DataRelation, or is it just a matter of > having a for loop within a for loop, or is it something else? > > > > Thanks, > > Ron > >
Collections challenge (MRU)
Createing the Domain searce dialog Can you insert elements into an XML file that exists as a string? MIDI guitar sheet music player in .net Refresh my memory on datatables, datasets etc. Changing the checked state of Dynamically added checkboxes Enum and Database question Release File Added Checkboxes Dynamically now I want change there state Retrieving 1 large sql record - progress bar possible? vb.net 2005 sql2000 |
|||||||||||||||||||||||