WindowsDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


AddThis Social Bookmark Button

Displaying Master-Details Relationships in ASP.NET 2.0
Pages: 1, 2, 3, 4, 5

Displaying the Details

In the last section, you displayed all the authors' information using the GridView control. Let's now display the books written by each author. The first step is to display the list of titles of books written by a particular author.



Add a new GridView control to the default.aspx page and choose a new data source (see Figure 8).


Figure 8. Adding a second GridView control

You will walk through the same steps as outlined in the last section, except that when it comes to selecting the table to display, you will select the titleauthor table (see Figure 9). In this case, you are only interested in displaying the ids of the books, hence select only the title_id column. In addition, the title_id of the books are dependent on which author is selected in the first GridView control, so you need to configure the data source by clicking the WHERE… button.


Figure 9. Configuring the data source for the second GridView control

In the Add WHERE Clause dialog, set its various fields as shown in Figure 10. Remember to click on the Add button to add the WHERE clause to the data source control.


Figure 10. The value for the au_id column is obtained from the first GridView control

Pages: 1, 2, 3, 4, 5

Next Pagearrow